@openfeed/sdk-js 0.2.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/DOCUMENTATION.md +217 -0
- package/LICENSE +28 -0
- package/README.md +29 -0
- package/SUBSCRIPTION_TYPES.md +200 -0
- package/SYMBOLS_EXCHANGES.md +17 -0
- package/dist/empty-411f875a.js +4 -0
- package/dist/generated/index.d.ts +6 -0
- package/dist/generated/openfeed.d.ts +1314 -0
- package/dist/generated/openfeed_api.d.ts +305 -0
- package/dist/generated/openfeed_instrument.d.ts +343 -0
- package/dist/generated/version.d.ts +1 -0
- package/dist/index.js +8676 -0
- package/dist/node.js +12325 -0
- package/dist/scripts/process.d.ts +1 -0
- package/dist/src/connection/connection.d.ts +61 -0
- package/dist/src/connection/connection_interfaces.d.ts +26 -0
- package/dist/src/connection/listeners.d.ts +14 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/test.d.ts +1 -0
- package/dist/src/utilities/async.d.ts +16 -0
- package/dist/src/utilities/empty.d.ts +2 -0
- package/dist/src/utilities/messages.d.ts +8 -0
- package/package.json +60 -0
- package/tsconfig.json +24 -0
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import Long from "long";
|
|
2
|
+
import _m0 from "protobufjs/minimal";
|
|
3
|
+
import { HeartBeat, InstrumentAction, MarketSnapshot, MarketStatus, MarketUpdate, Ohlc, Service, VolumeAtPrice } from "./openfeed";
|
|
4
|
+
import { InstrumentDefinition, InstrumentDefinition_InstrumentType } from "./openfeed_instrument";
|
|
5
|
+
export declare enum Result {
|
|
6
|
+
UNKNOWN_RESULT = 0,
|
|
7
|
+
SUCCESS = 1,
|
|
8
|
+
INSTRUMENTS_NOT_FOUND = 112,
|
|
9
|
+
JWT_EXPIRED = 113,
|
|
10
|
+
JWT_INVALID = 114,
|
|
11
|
+
DUPLICATE_LOGIN = 115,
|
|
12
|
+
INVALID_SYMBOL = 116,
|
|
13
|
+
INVALID_MARKET_ID = 117,
|
|
14
|
+
INVALID_EXCHANGE = 118,
|
|
15
|
+
INVALID_CHANNEL_ID = 119,
|
|
16
|
+
MALFORMED_MESSAGE = 120,
|
|
17
|
+
UNEXPECTED_MESSAGE = 121,
|
|
18
|
+
NOT_SUBSCRIBED = 122,
|
|
19
|
+
DUPLICATE_SUBSCRIPTION = 123,
|
|
20
|
+
INVALID_CREDENTIALS = 124,
|
|
21
|
+
INSUFFICIENT_PRIVILEGES = 125,
|
|
22
|
+
AUTHENTICATION_REQUIRED = 126,
|
|
23
|
+
GENERIC_FAILURE = 127,
|
|
24
|
+
UNRECOGNIZED = -1
|
|
25
|
+
}
|
|
26
|
+
export declare enum SubscriptionType {
|
|
27
|
+
ALL = 0,
|
|
28
|
+
QUOTE = 1,
|
|
29
|
+
QUOTE_PARTICIPANT = 2,
|
|
30
|
+
DEPTH_PRICE = 3,
|
|
31
|
+
DEPTH_ORDER = 4,
|
|
32
|
+
TRADES = 5,
|
|
33
|
+
CUMLATIVE_VOLUME = 6,
|
|
34
|
+
OHLC = 7,
|
|
35
|
+
OHLC_NON_REGULAR = 8,
|
|
36
|
+
UNRECOGNIZED = -1
|
|
37
|
+
}
|
|
38
|
+
/** / Symbol type for the subscription filter. */
|
|
39
|
+
export declare enum SymbolType {
|
|
40
|
+
BARCHART = 0,
|
|
41
|
+
EXCHANGE = 1,
|
|
42
|
+
UNRECOGNIZED = -1
|
|
43
|
+
}
|
|
44
|
+
/** / Openfeed Server request */
|
|
45
|
+
export interface OpenfeedGatewayRequest {
|
|
46
|
+
loginRequest?: LoginRequest | undefined;
|
|
47
|
+
logoutRequest?: LogoutRequest | undefined;
|
|
48
|
+
subscriptionRequest?: SubscriptionRequest | undefined;
|
|
49
|
+
instrumentRequest?: InstrumentRequest | undefined;
|
|
50
|
+
instrumentReferenceRequest?: InstrumentReferenceRequest | undefined;
|
|
51
|
+
exchangeRequest?: ExchangeRequest | undefined;
|
|
52
|
+
}
|
|
53
|
+
/** / Openfeed Server Response */
|
|
54
|
+
export interface OpenfeedGatewayMessage {
|
|
55
|
+
loginResponse?: LoginResponse | undefined;
|
|
56
|
+
logoutResponse?: LogoutResponse | undefined;
|
|
57
|
+
instrumentResponse?: InstrumentResponse | undefined;
|
|
58
|
+
instrumentReferenceResponse?: InstrumentReferenceResponse | undefined;
|
|
59
|
+
subscriptionResponse?: SubscriptionResponse | undefined;
|
|
60
|
+
marketStatus?: MarketStatus | undefined;
|
|
61
|
+
heartBeat?: HeartBeat | undefined;
|
|
62
|
+
instrumentDefinition?: InstrumentDefinition | undefined;
|
|
63
|
+
marketSnapshot?: MarketSnapshot | undefined;
|
|
64
|
+
marketUpdate?: MarketUpdate | undefined;
|
|
65
|
+
volumeAtPrice?: VolumeAtPrice | undefined;
|
|
66
|
+
ohlc?: Ohlc | undefined;
|
|
67
|
+
exchangeResponse?: ExchangeResponse | undefined;
|
|
68
|
+
instrumentAction?: InstrumentAction | undefined;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* //////////////////
|
|
72
|
+
* Serivce Messages
|
|
73
|
+
* /////////////////
|
|
74
|
+
*/
|
|
75
|
+
export interface Status {
|
|
76
|
+
result: Result;
|
|
77
|
+
message: string;
|
|
78
|
+
service: Service;
|
|
79
|
+
}
|
|
80
|
+
/** / Login */
|
|
81
|
+
export interface LoginRequest {
|
|
82
|
+
correlationId: Long;
|
|
83
|
+
username: string;
|
|
84
|
+
password: string;
|
|
85
|
+
clientVersion: string;
|
|
86
|
+
protocolVersion: number;
|
|
87
|
+
/** / JSON Web Token */
|
|
88
|
+
jwt: string;
|
|
89
|
+
}
|
|
90
|
+
export interface LoginResponse {
|
|
91
|
+
correlationId: Long;
|
|
92
|
+
status: Status | undefined;
|
|
93
|
+
token: string;
|
|
94
|
+
}
|
|
95
|
+
/** / Logout */
|
|
96
|
+
export interface LogoutRequest {
|
|
97
|
+
correlationId: Long;
|
|
98
|
+
token: string;
|
|
99
|
+
}
|
|
100
|
+
export interface LogoutResponse {
|
|
101
|
+
correlationId: Long;
|
|
102
|
+
status: Status | undefined;
|
|
103
|
+
}
|
|
104
|
+
/** / Instrument Definition(s), will stream InstrumentDefinition(s) */
|
|
105
|
+
export interface InstrumentRequest {
|
|
106
|
+
correlationId: Long;
|
|
107
|
+
token: string;
|
|
108
|
+
/** / Filter on these instrument types */
|
|
109
|
+
instrumentType: InstrumentDefinition_InstrumentType[];
|
|
110
|
+
/** / Filter on these spread types */
|
|
111
|
+
spreadType: string[];
|
|
112
|
+
/** / If version >= 1 then will send InstrumentDefinition in the InstrumentResponse */
|
|
113
|
+
version: number;
|
|
114
|
+
symbol?: string | undefined;
|
|
115
|
+
marketId?: Long | undefined;
|
|
116
|
+
exchange?: string | undefined;
|
|
117
|
+
channelId?: number | undefined;
|
|
118
|
+
}
|
|
119
|
+
export interface InstrumentResponse {
|
|
120
|
+
correlationId: Long;
|
|
121
|
+
status: Status | undefined;
|
|
122
|
+
numberOfDefinitions: number;
|
|
123
|
+
/** */
|
|
124
|
+
symbol: string;
|
|
125
|
+
marketId: Long;
|
|
126
|
+
exchange: string;
|
|
127
|
+
channelId: number;
|
|
128
|
+
exchangeId: number;
|
|
129
|
+
/** / Will be set if InstrumentRequest.version >= 1 */
|
|
130
|
+
instrumentDefinition: InstrumentDefinition | undefined;
|
|
131
|
+
}
|
|
132
|
+
/** / Instrument References, returns InstrumentReferenceResponse(s) */
|
|
133
|
+
export interface InstrumentReferenceRequest {
|
|
134
|
+
correlationId: Long;
|
|
135
|
+
token: string;
|
|
136
|
+
symbol?: string | undefined;
|
|
137
|
+
marketId?: Long | undefined;
|
|
138
|
+
exchange?: string | undefined;
|
|
139
|
+
channelId?: number | undefined;
|
|
140
|
+
}
|
|
141
|
+
export interface InstrumentReferenceResponse {
|
|
142
|
+
correlationId: Long;
|
|
143
|
+
status: Status | undefined;
|
|
144
|
+
numberOfDefinitions: number;
|
|
145
|
+
/** */
|
|
146
|
+
channelId: number;
|
|
147
|
+
marketId: Long;
|
|
148
|
+
symbol: string;
|
|
149
|
+
exchange: string;
|
|
150
|
+
ddfSymbol: string;
|
|
151
|
+
ddfExchange: string;
|
|
152
|
+
ddfBaseCode: string;
|
|
153
|
+
exchangeSymbol: string;
|
|
154
|
+
exchangeId: number;
|
|
155
|
+
}
|
|
156
|
+
/** / Exchange Request, returns ExchangeResponse. Gives available exchanges. */
|
|
157
|
+
export interface ExchangeRequest {
|
|
158
|
+
correlationId: Long;
|
|
159
|
+
token: string;
|
|
160
|
+
}
|
|
161
|
+
export interface ExchangeResponse {
|
|
162
|
+
correlationId: Long;
|
|
163
|
+
status: Status | undefined;
|
|
164
|
+
exchanges: ExchangeResponse_Exchange[];
|
|
165
|
+
}
|
|
166
|
+
export interface ExchangeResponse_Exchange {
|
|
167
|
+
code: string;
|
|
168
|
+
description: string;
|
|
169
|
+
aliases: string[];
|
|
170
|
+
exchangeId: number;
|
|
171
|
+
}
|
|
172
|
+
/** / Bulk subscription filter. */
|
|
173
|
+
export interface BulkSubscriptionFilter {
|
|
174
|
+
/** / Type of the symbol: Barchart or Exchange. Barchart is the default. */
|
|
175
|
+
symbolType: SymbolType;
|
|
176
|
+
/** / regular expression pattern for the symbol */
|
|
177
|
+
symbolPattern: string;
|
|
178
|
+
}
|
|
179
|
+
/** / Subscription Request */
|
|
180
|
+
export interface SubscriptionRequest {
|
|
181
|
+
/** / Client-assigned id for this request. Response will include same id */
|
|
182
|
+
correlationId: Long;
|
|
183
|
+
token: string;
|
|
184
|
+
/** / Preferred service (realtime or delayed). REAL_TIME is the default. */
|
|
185
|
+
service: Service;
|
|
186
|
+
unsubscribe: boolean;
|
|
187
|
+
requests: SubscriptionRequest_Request[];
|
|
188
|
+
}
|
|
189
|
+
export interface SubscriptionRequest_Request {
|
|
190
|
+
symbol?: string | undefined;
|
|
191
|
+
marketId?: Long | undefined;
|
|
192
|
+
exchange?: string | undefined;
|
|
193
|
+
channelId?: number | undefined;
|
|
194
|
+
subscriptionType: SubscriptionType[];
|
|
195
|
+
/** / 0 = send only current snapshot once, else send at interval seconds */
|
|
196
|
+
snapshotIntervalSeconds: number;
|
|
197
|
+
/** / Spreads and Options must be explicitly requested. */
|
|
198
|
+
instrumentType: InstrumentDefinition_InstrumentType[];
|
|
199
|
+
/** / Filter for the exchange and channel subscriptions. */
|
|
200
|
+
bulkSubscriptionFilter: BulkSubscriptionFilter[];
|
|
201
|
+
/** / Filter for Spread Types */
|
|
202
|
+
spreadTypeFilter: string[];
|
|
203
|
+
}
|
|
204
|
+
export interface SubscriptionResponse {
|
|
205
|
+
correlationId: Long;
|
|
206
|
+
status: Status | undefined;
|
|
207
|
+
symbol: string;
|
|
208
|
+
marketId: Long;
|
|
209
|
+
exchange: string;
|
|
210
|
+
channelId: number;
|
|
211
|
+
numberOfDefinitions: number;
|
|
212
|
+
subscriptionType: SubscriptionType;
|
|
213
|
+
unsubscribe: boolean;
|
|
214
|
+
snapshotIntervalSeconds: number;
|
|
215
|
+
}
|
|
216
|
+
export declare const OpenfeedGatewayRequestEncode: {
|
|
217
|
+
encode(message: OpenfeedGatewayRequest, writer?: _m0.Writer): _m0.Writer;
|
|
218
|
+
}, OpenfeedGatewayRequestDecode: {
|
|
219
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): OpenfeedGatewayRequest;
|
|
220
|
+
};
|
|
221
|
+
export declare const OpenfeedGatewayMessageEncode: {
|
|
222
|
+
encode(message: OpenfeedGatewayMessage, writer?: _m0.Writer): _m0.Writer;
|
|
223
|
+
}, OpenfeedGatewayMessageDecode: {
|
|
224
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): OpenfeedGatewayMessage;
|
|
225
|
+
};
|
|
226
|
+
export declare const StatusEncode: {
|
|
227
|
+
encode(message: Status, writer?: _m0.Writer): _m0.Writer;
|
|
228
|
+
}, StatusDecode: {
|
|
229
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): Status;
|
|
230
|
+
};
|
|
231
|
+
export declare const LoginRequestEncode: {
|
|
232
|
+
encode(message: LoginRequest, writer?: _m0.Writer): _m0.Writer;
|
|
233
|
+
}, LoginRequestDecode: {
|
|
234
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): LoginRequest;
|
|
235
|
+
};
|
|
236
|
+
export declare const LoginResponseEncode: {
|
|
237
|
+
encode(message: LoginResponse, writer?: _m0.Writer): _m0.Writer;
|
|
238
|
+
}, LoginResponseDecode: {
|
|
239
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): LoginResponse;
|
|
240
|
+
};
|
|
241
|
+
export declare const LogoutRequestEncode: {
|
|
242
|
+
encode(message: LogoutRequest, writer?: _m0.Writer): _m0.Writer;
|
|
243
|
+
}, LogoutRequestDecode: {
|
|
244
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): LogoutRequest;
|
|
245
|
+
};
|
|
246
|
+
export declare const LogoutResponseEncode: {
|
|
247
|
+
encode(message: LogoutResponse, writer?: _m0.Writer): _m0.Writer;
|
|
248
|
+
}, LogoutResponseDecode: {
|
|
249
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): LogoutResponse;
|
|
250
|
+
};
|
|
251
|
+
export declare const InstrumentRequestEncode: {
|
|
252
|
+
encode(message: InstrumentRequest, writer?: _m0.Writer): _m0.Writer;
|
|
253
|
+
}, InstrumentRequestDecode: {
|
|
254
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): InstrumentRequest;
|
|
255
|
+
};
|
|
256
|
+
export declare const InstrumentResponseEncode: {
|
|
257
|
+
encode(message: InstrumentResponse, writer?: _m0.Writer): _m0.Writer;
|
|
258
|
+
}, InstrumentResponseDecode: {
|
|
259
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): InstrumentResponse;
|
|
260
|
+
};
|
|
261
|
+
export declare const InstrumentReferenceRequestEncode: {
|
|
262
|
+
encode(message: InstrumentReferenceRequest, writer?: _m0.Writer): _m0.Writer;
|
|
263
|
+
}, InstrumentReferenceRequestDecode: {
|
|
264
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): InstrumentReferenceRequest;
|
|
265
|
+
};
|
|
266
|
+
export declare const InstrumentReferenceResponseEncode: {
|
|
267
|
+
encode(message: InstrumentReferenceResponse, writer?: _m0.Writer): _m0.Writer;
|
|
268
|
+
}, InstrumentReferenceResponseDecode: {
|
|
269
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): InstrumentReferenceResponse;
|
|
270
|
+
};
|
|
271
|
+
export declare const ExchangeRequestEncode: {
|
|
272
|
+
encode(message: ExchangeRequest, writer?: _m0.Writer): _m0.Writer;
|
|
273
|
+
}, ExchangeRequestDecode: {
|
|
274
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): ExchangeRequest;
|
|
275
|
+
};
|
|
276
|
+
export declare const ExchangeResponseEncode: {
|
|
277
|
+
encode(message: ExchangeResponse, writer?: _m0.Writer): _m0.Writer;
|
|
278
|
+
}, ExchangeResponseDecode: {
|
|
279
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): ExchangeResponse;
|
|
280
|
+
};
|
|
281
|
+
export declare const ExchangeResponse_ExchangeEncode: {
|
|
282
|
+
encode(message: ExchangeResponse_Exchange, writer?: _m0.Writer): _m0.Writer;
|
|
283
|
+
}, ExchangeResponse_ExchangeDecode: {
|
|
284
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): ExchangeResponse_Exchange;
|
|
285
|
+
};
|
|
286
|
+
export declare const BulkSubscriptionFilterEncode: {
|
|
287
|
+
encode(message: BulkSubscriptionFilter, writer?: _m0.Writer): _m0.Writer;
|
|
288
|
+
}, BulkSubscriptionFilterDecode: {
|
|
289
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): BulkSubscriptionFilter;
|
|
290
|
+
};
|
|
291
|
+
export declare const SubscriptionRequestEncode: {
|
|
292
|
+
encode(message: SubscriptionRequest, writer?: _m0.Writer): _m0.Writer;
|
|
293
|
+
}, SubscriptionRequestDecode: {
|
|
294
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): SubscriptionRequest;
|
|
295
|
+
};
|
|
296
|
+
export declare const SubscriptionRequest_RequestEncode: {
|
|
297
|
+
encode(message: SubscriptionRequest_Request, writer?: _m0.Writer): _m0.Writer;
|
|
298
|
+
}, SubscriptionRequest_RequestDecode: {
|
|
299
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): SubscriptionRequest_Request;
|
|
300
|
+
};
|
|
301
|
+
export declare const SubscriptionResponseEncode: {
|
|
302
|
+
encode(message: SubscriptionResponse, writer?: _m0.Writer): _m0.Writer;
|
|
303
|
+
}, SubscriptionResponseDecode: {
|
|
304
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): SubscriptionResponse;
|
|
305
|
+
};
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
import Long from "long";
|
|
2
|
+
import _m0 from "protobufjs/minimal";
|
|
3
|
+
export interface InstrumentDefinition {
|
|
4
|
+
/** / Unique ID used in the data feed. */
|
|
5
|
+
marketId: Long;
|
|
6
|
+
/** / Instrument type as enum... */
|
|
7
|
+
instrumentType: InstrumentDefinition_InstrumentType;
|
|
8
|
+
/** / Supported Book Types */
|
|
9
|
+
supportBookTypes: InstrumentDefinition_BookType[];
|
|
10
|
+
/** / Maximum depth of market-by-price order book */
|
|
11
|
+
bookDepth: number;
|
|
12
|
+
/** / The name of the market data vendor */
|
|
13
|
+
vendorId: string;
|
|
14
|
+
/**
|
|
15
|
+
* / Human readable market symbol, assigned by the exchange or venue.
|
|
16
|
+
* Not necessarily unique as the exchange or vendor could assign the same symbol to different
|
|
17
|
+
* instruments, for example if the instruments trade on different exchanges.
|
|
18
|
+
*/
|
|
19
|
+
symbol: string;
|
|
20
|
+
/** / Human readable market description. */
|
|
21
|
+
description: string;
|
|
22
|
+
/** / Market CFI code: http://en.wikipedia.org/wiki/ISO_10962 */
|
|
23
|
+
cfiCode: string;
|
|
24
|
+
/** / Market currency code: http://en.wikipedia.org/wiki/ISO_4217 */
|
|
25
|
+
currencyCode: string;
|
|
26
|
+
/**
|
|
27
|
+
* Market exchange code: http://en.wikipedia.org/wiki/ISO_10383
|
|
28
|
+
* For inter-exchange spreads, use the leg MICs separated by a hyphen
|
|
29
|
+
*/
|
|
30
|
+
exchangeCode: string;
|
|
31
|
+
/** / Minimum price increment in market currency. */
|
|
32
|
+
minimumPriceIncrement: number;
|
|
33
|
+
/** / Contract point value in market currency. */
|
|
34
|
+
contractPointValue: number;
|
|
35
|
+
/** / Trading schedule for a typical week */
|
|
36
|
+
schedule: InstrumentDefinition_Schedule | undefined;
|
|
37
|
+
/** / Trading calendar (expiration, notice days, holidays?, etc) */
|
|
38
|
+
calendar: InstrumentDefinition_Calendar | undefined;
|
|
39
|
+
/** / UTC Timestamp of creation, nano seconds since Unix epoch */
|
|
40
|
+
recordCreateTime: Long;
|
|
41
|
+
/** / UTC Timestamp of update, nano seconds since Unix epoch */
|
|
42
|
+
recordUpdateTime: Long;
|
|
43
|
+
/**
|
|
44
|
+
* / Market time zone TZ database name.
|
|
45
|
+
* Permanent. Can be resolved into timeZoneOffset for given date/time.
|
|
46
|
+
* See http://joda-time.sourceforge.net/timezones.html
|
|
47
|
+
* See http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
|
48
|
+
*/
|
|
49
|
+
timeZoneName: string;
|
|
50
|
+
/** / Identifies a logical grouping of instruments. By product, for example. */
|
|
51
|
+
instrumentGroup: string;
|
|
52
|
+
/** / The Date of expiration for futures and options. */
|
|
53
|
+
symbolExpiration: InstrumentDefinition_MaturityDate | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* / active: can have market state updates, can have historical data
|
|
56
|
+
* passive: can NOT have market state updates, but can have historical data
|
|
57
|
+
* normally "active" means newly listed or currently non expired markets
|
|
58
|
+
* normally "passive" means expired options, de-listed equities, etc.
|
|
59
|
+
*/
|
|
60
|
+
state: InstrumentDefinition_State;
|
|
61
|
+
/** / The channel that updates for this instrument will appear on. */
|
|
62
|
+
channel: number;
|
|
63
|
+
/**
|
|
64
|
+
* / The marketId of the underlying asset.
|
|
65
|
+
* Used by Futures and Options when the underlying instrument is defined by the vendor
|
|
66
|
+
*/
|
|
67
|
+
underlyingMarketId: Long;
|
|
68
|
+
/** / Display format */
|
|
69
|
+
priceFormat: InstrumentDefinition_PriceFormat | undefined;
|
|
70
|
+
/** / Strike price display format */
|
|
71
|
+
optionStrikePriceFormat: InstrumentDefinition_PriceFormat | undefined;
|
|
72
|
+
/** / Divide prices by this value to get real price values */
|
|
73
|
+
priceDenominator: number;
|
|
74
|
+
/** / Divide trade quantities by this value to get real quantities */
|
|
75
|
+
quantityDenominator: number;
|
|
76
|
+
/** / true if this is a tradable instrument */
|
|
77
|
+
isTradable: boolean;
|
|
78
|
+
/** / UTC timestamp of transaction, nano seconds since Unix epoch */
|
|
79
|
+
transactionTime: Long;
|
|
80
|
+
/** / For internal use only. Ignore */
|
|
81
|
+
auxiliaryData: Uint8Array;
|
|
82
|
+
/**
|
|
83
|
+
* / List of alternate symbols for this instrument. A single instrument
|
|
84
|
+
* may be provided by many different market data vendors, each with
|
|
85
|
+
* their own unique symbology. Allows this instrument to be tagged
|
|
86
|
+
* with as many vendor symbols as necessary.
|
|
87
|
+
*/
|
|
88
|
+
symbols: InstrumentDefinition_Symbol[];
|
|
89
|
+
/**
|
|
90
|
+
* / Option strike price in market currency. Multiply by
|
|
91
|
+
* / factorOptionsStrike to get actual strike
|
|
92
|
+
*/
|
|
93
|
+
optionStrike: Long;
|
|
94
|
+
/** / Option type: call vs put. */
|
|
95
|
+
optionType: InstrumentDefinition_OptionType;
|
|
96
|
+
/** / Option style : American vs European. */
|
|
97
|
+
optionStyle: InstrumentDefinition_OptionStyle;
|
|
98
|
+
/** / Divide optionStrike by this value to get real strike price */
|
|
99
|
+
optionStrikeDenominator: number;
|
|
100
|
+
/** / Spread type, can be vendor specific */
|
|
101
|
+
spreadCode: string;
|
|
102
|
+
/** / Ordered list of underlying legs in a spread. */
|
|
103
|
+
spreadLeg: InstrumentDefinition_SpreadLeg[];
|
|
104
|
+
/** / true if user defined spread */
|
|
105
|
+
userDefinedSpread: boolean;
|
|
106
|
+
/** / Listing market classification */
|
|
107
|
+
marketTier: string;
|
|
108
|
+
/** / Current financial status of the issuer */
|
|
109
|
+
financialStatusIndicator: string;
|
|
110
|
+
/** / ISIN: https://en.wikipedia.org/wiki/International_Securities_Identification_Number */
|
|
111
|
+
isin: string;
|
|
112
|
+
/** / Break out of currency pair */
|
|
113
|
+
currencyPair: InstrumentDefinition_CurrencyPair | undefined;
|
|
114
|
+
/** / true if exchange sends volume. */
|
|
115
|
+
exchangeSendsVolume: boolean;
|
|
116
|
+
/** / true if exchange sends high. */
|
|
117
|
+
exchangeSendsHigh: boolean;
|
|
118
|
+
/** / true if exchange sends low. */
|
|
119
|
+
exchangeSendsLow: boolean;
|
|
120
|
+
/** / true if exchange sends open. */
|
|
121
|
+
exchangeSendsOpen: boolean;
|
|
122
|
+
/** / true if this instrument represents consolidated NBBO. */
|
|
123
|
+
consolidatedFeedInstrument: boolean;
|
|
124
|
+
/** / true if this instrument represents Pit symbol. */
|
|
125
|
+
openOutcryInstrument: boolean;
|
|
126
|
+
/** / true if this instrument generated FX option. */
|
|
127
|
+
syntheticAmericanOptionInstrument: boolean;
|
|
128
|
+
/** / */
|
|
129
|
+
barchartExchangeCode: string;
|
|
130
|
+
/** / */
|
|
131
|
+
barchartBaseCode: string;
|
|
132
|
+
/** / */
|
|
133
|
+
volumeDenominator: number;
|
|
134
|
+
/** / */
|
|
135
|
+
bidOfferQuantityDenominator: number;
|
|
136
|
+
/** / */
|
|
137
|
+
primaryListingMarketParticipantId: string;
|
|
138
|
+
/** / */
|
|
139
|
+
subscriptionSymbol: string;
|
|
140
|
+
/** / The Month/ Day of expiration for futures and options. Corresponds to the expiration month. */
|
|
141
|
+
contractMaturity: InstrumentDefinition_MaturityDate | undefined;
|
|
142
|
+
/** / Barchart Underlying Symbol */
|
|
143
|
+
underlying: string;
|
|
144
|
+
commodity: string;
|
|
145
|
+
/** / Barchart Exchange Id */
|
|
146
|
+
exchangeId: number;
|
|
147
|
+
/** / Barchart Price Scaling Exponent */
|
|
148
|
+
priceScalingExponent: number;
|
|
149
|
+
/** / The Openfeed marketId of the underlying asset. */
|
|
150
|
+
underlyingOpenfeedMarketId: Long;
|
|
151
|
+
}
|
|
152
|
+
/** ############################################# */
|
|
153
|
+
export declare enum InstrumentDefinition_InstrumentType {
|
|
154
|
+
UNKNOWN_INSTRUMENT_TYPE = 0,
|
|
155
|
+
FOREX = 1,
|
|
156
|
+
INDEX = 2,
|
|
157
|
+
EQUITY = 3,
|
|
158
|
+
FUTURE = 4,
|
|
159
|
+
OPTION = 5,
|
|
160
|
+
SPREAD = 6,
|
|
161
|
+
MUTUAL_FUND = 7,
|
|
162
|
+
MONEY_MARKET_FUND = 8,
|
|
163
|
+
USER_DEFINED_SPREAD = 9,
|
|
164
|
+
EQUITY_OPTION = 10,
|
|
165
|
+
UNRECOGNIZED = -1
|
|
166
|
+
}
|
|
167
|
+
/** / Market depth implementation type */
|
|
168
|
+
export declare enum InstrumentDefinition_BookType {
|
|
169
|
+
UNKNOWN_BOOK_TYPE = 0,
|
|
170
|
+
/** TOP_OF_BOOK - BBO */
|
|
171
|
+
TOP_OF_BOOK = 1,
|
|
172
|
+
/** PRICE_LEVEL_DEPTH - Book uses price level */
|
|
173
|
+
PRICE_LEVEL_DEPTH = 2,
|
|
174
|
+
/** ORDER_DEPTH - Book uses order-id */
|
|
175
|
+
ORDER_DEPTH = 3,
|
|
176
|
+
UNRECOGNIZED = -1
|
|
177
|
+
}
|
|
178
|
+
/** / Option type. */
|
|
179
|
+
export declare enum InstrumentDefinition_OptionType {
|
|
180
|
+
UNKNOWN_OPTION_TYPE = 0,
|
|
181
|
+
CALL = 1,
|
|
182
|
+
PUT = 2,
|
|
183
|
+
UNRECOGNIZED = -1
|
|
184
|
+
}
|
|
185
|
+
/** / Option style. */
|
|
186
|
+
export declare enum InstrumentDefinition_OptionStyle {
|
|
187
|
+
UNKNOWN_OPTIONS_STYLE = 0,
|
|
188
|
+
DEFAULT = 1,
|
|
189
|
+
AMERICAN = 2,
|
|
190
|
+
EUROPEAN = 3,
|
|
191
|
+
UNRECOGNIZED = -1
|
|
192
|
+
}
|
|
193
|
+
export declare enum InstrumentDefinition_State {
|
|
194
|
+
UNKNOWN_STATE = 0,
|
|
195
|
+
ACTIVE = 1,
|
|
196
|
+
PASSIVE = 2,
|
|
197
|
+
UNRECOGNIZED = -1
|
|
198
|
+
}
|
|
199
|
+
export declare enum InstrumentDefinition_EventType {
|
|
200
|
+
UNKNOWN_EVENT_TYPE = 0,
|
|
201
|
+
/** FIRST_TRADE_DATE - All instruments */
|
|
202
|
+
FIRST_TRADE_DATE = 1,
|
|
203
|
+
LAST_TRADE_DATE = 2,
|
|
204
|
+
/** MATURITY_DATE - Futures only */
|
|
205
|
+
MATURITY_DATE = 10,
|
|
206
|
+
FIRST_DELIVERY_DATE = 11,
|
|
207
|
+
LAST_DELIVERY_DATE = 12,
|
|
208
|
+
FIRST_NOTICE_DATE = 13,
|
|
209
|
+
LAST_NOTICE_DATE = 14,
|
|
210
|
+
FIRST_HOLDING_DATE = 15,
|
|
211
|
+
LAST_HOLDING_DATE = 16,
|
|
212
|
+
FIRST_POSITION_DATE = 17,
|
|
213
|
+
LAST_POSITION_DATE = 18,
|
|
214
|
+
/** DELIVERY_START_DATE - Grain Bids */
|
|
215
|
+
DELIVERY_START_DATE = 30,
|
|
216
|
+
DELIVERY_END_DATE = 31,
|
|
217
|
+
UNRECOGNIZED = -1
|
|
218
|
+
}
|
|
219
|
+
/** / Typical trading week schedule */
|
|
220
|
+
export interface InstrumentDefinition_Schedule {
|
|
221
|
+
sessions: InstrumentDefinition_TimeSpan[];
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* / Trading session
|
|
225
|
+
* Times are in nanos since midnight UTC on the Sunday starting a given trading week
|
|
226
|
+
*/
|
|
227
|
+
export interface InstrumentDefinition_TimeSpan {
|
|
228
|
+
timeStart: Long;
|
|
229
|
+
timeFinish: Long;
|
|
230
|
+
}
|
|
231
|
+
export interface InstrumentDefinition_Calendar {
|
|
232
|
+
events: InstrumentDefinition_Event[];
|
|
233
|
+
}
|
|
234
|
+
export interface InstrumentDefinition_Event {
|
|
235
|
+
type: InstrumentDefinition_EventType;
|
|
236
|
+
/** / Epoch time in ms */
|
|
237
|
+
date: Long;
|
|
238
|
+
}
|
|
239
|
+
export interface InstrumentDefinition_SpreadLeg {
|
|
240
|
+
/** The marketId of the leg */
|
|
241
|
+
marketId: Long;
|
|
242
|
+
/**
|
|
243
|
+
* The ratio of the this leg with respect to the spread.
|
|
244
|
+
* Negative means short the absolute value, positive means long the absolute value.
|
|
245
|
+
* FIXME? Alternatively, we could have separate LONG/SHORT indicator in the message
|
|
246
|
+
* and use this field as only the absolute value
|
|
247
|
+
*/
|
|
248
|
+
ratio: number;
|
|
249
|
+
symbol: string;
|
|
250
|
+
longSymbol: string;
|
|
251
|
+
legOptionDelta: number;
|
|
252
|
+
/**
|
|
253
|
+
* Additional information about the leg will be found in the instrument definition
|
|
254
|
+
* for the leg. It is not included here to reduce duplication.
|
|
255
|
+
*/
|
|
256
|
+
legPrice: number;
|
|
257
|
+
}
|
|
258
|
+
/** / Date and time with time zone. */
|
|
259
|
+
export interface InstrumentDefinition_MaturityDate {
|
|
260
|
+
/** Year of century. */
|
|
261
|
+
year: number;
|
|
262
|
+
/** Month of year. */
|
|
263
|
+
month: number;
|
|
264
|
+
/** Day of month. */
|
|
265
|
+
day: number;
|
|
266
|
+
}
|
|
267
|
+
/** / A vendor's symbol for an instrument */
|
|
268
|
+
export interface InstrumentDefinition_Symbol {
|
|
269
|
+
/** The vendor that provides this symbol. */
|
|
270
|
+
vendor: string;
|
|
271
|
+
/** The symbol assigned by the vendor. */
|
|
272
|
+
symbol: string;
|
|
273
|
+
/** The long symbol assigned by the vendor. Includes 2 char year for futures. */
|
|
274
|
+
longSymbol: string;
|
|
275
|
+
}
|
|
276
|
+
/** / Recommended display format for prices. */
|
|
277
|
+
export interface InstrumentDefinition_PriceFormat {
|
|
278
|
+
isFractional: boolean;
|
|
279
|
+
denominator: number;
|
|
280
|
+
subDenominator: number;
|
|
281
|
+
subFormat: InstrumentDefinition_PriceFormat_SubFormat;
|
|
282
|
+
}
|
|
283
|
+
export declare enum InstrumentDefinition_PriceFormat_SubFormat {
|
|
284
|
+
FLAT = 0,
|
|
285
|
+
FRACTIONAL = 1,
|
|
286
|
+
DECIMAL = 2,
|
|
287
|
+
UNRECOGNIZED = -1
|
|
288
|
+
}
|
|
289
|
+
/** / Currency Pair */
|
|
290
|
+
export interface InstrumentDefinition_CurrencyPair {
|
|
291
|
+
currency1: string;
|
|
292
|
+
currency2: string;
|
|
293
|
+
}
|
|
294
|
+
export declare const InstrumentDefinitionEncode: {
|
|
295
|
+
encode(message: InstrumentDefinition, writer?: _m0.Writer): _m0.Writer;
|
|
296
|
+
}, InstrumentDefinitionDecode: {
|
|
297
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): InstrumentDefinition;
|
|
298
|
+
};
|
|
299
|
+
export declare const InstrumentDefinition_ScheduleEncode: {
|
|
300
|
+
encode(message: InstrumentDefinition_Schedule, writer?: _m0.Writer): _m0.Writer;
|
|
301
|
+
}, InstrumentDefinition_ScheduleDecode: {
|
|
302
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): InstrumentDefinition_Schedule;
|
|
303
|
+
};
|
|
304
|
+
export declare const InstrumentDefinition_TimeSpanEncode: {
|
|
305
|
+
encode(message: InstrumentDefinition_TimeSpan, writer?: _m0.Writer): _m0.Writer;
|
|
306
|
+
}, InstrumentDefinition_TimeSpanDecode: {
|
|
307
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): InstrumentDefinition_TimeSpan;
|
|
308
|
+
};
|
|
309
|
+
export declare const InstrumentDefinition_CalendarEncode: {
|
|
310
|
+
encode(message: InstrumentDefinition_Calendar, writer?: _m0.Writer): _m0.Writer;
|
|
311
|
+
}, InstrumentDefinition_CalendarDecode: {
|
|
312
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): InstrumentDefinition_Calendar;
|
|
313
|
+
};
|
|
314
|
+
export declare const InstrumentDefinition_EventEncode: {
|
|
315
|
+
encode(message: InstrumentDefinition_Event, writer?: _m0.Writer): _m0.Writer;
|
|
316
|
+
}, InstrumentDefinition_EventDecode: {
|
|
317
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): InstrumentDefinition_Event;
|
|
318
|
+
};
|
|
319
|
+
export declare const InstrumentDefinition_SpreadLegEncode: {
|
|
320
|
+
encode(message: InstrumentDefinition_SpreadLeg, writer?: _m0.Writer): _m0.Writer;
|
|
321
|
+
}, InstrumentDefinition_SpreadLegDecode: {
|
|
322
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): InstrumentDefinition_SpreadLeg;
|
|
323
|
+
};
|
|
324
|
+
export declare const InstrumentDefinition_MaturityDateEncode: {
|
|
325
|
+
encode(message: InstrumentDefinition_MaturityDate, writer?: _m0.Writer): _m0.Writer;
|
|
326
|
+
}, InstrumentDefinition_MaturityDateDecode: {
|
|
327
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): InstrumentDefinition_MaturityDate;
|
|
328
|
+
};
|
|
329
|
+
export declare const InstrumentDefinition_SymbolEncode: {
|
|
330
|
+
encode(message: InstrumentDefinition_Symbol, writer?: _m0.Writer): _m0.Writer;
|
|
331
|
+
}, InstrumentDefinition_SymbolDecode: {
|
|
332
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): InstrumentDefinition_Symbol;
|
|
333
|
+
};
|
|
334
|
+
export declare const InstrumentDefinition_PriceFormatEncode: {
|
|
335
|
+
encode(message: InstrumentDefinition_PriceFormat, writer?: _m0.Writer): _m0.Writer;
|
|
336
|
+
}, InstrumentDefinition_PriceFormatDecode: {
|
|
337
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): InstrumentDefinition_PriceFormat;
|
|
338
|
+
};
|
|
339
|
+
export declare const InstrumentDefinition_CurrencyPairEncode: {
|
|
340
|
+
encode(message: InstrumentDefinition_CurrencyPair, writer?: _m0.Writer): _m0.Writer;
|
|
341
|
+
}, InstrumentDefinition_CurrencyPairDecode: {
|
|
342
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): InstrumentDefinition_CurrencyPair;
|
|
343
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const version = "0.2.0";
|