@openfeed/sdk-js 1.2.2 → 1.3.1
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/.releases/CHANGELOG-1.2.3.md +10 -0
- package/.releases/CHANGELOG-1.3.0.md +10 -0
- package/.releases/CHANGELOG-1.3.1.md +10 -0
- package/CHANGELOG.md +2 -2
- package/dist/generated/openfeed.d.ts +3 -0
- package/dist/generated/openfeed_api.d.ts +16 -2
- package/dist/generated/version.d.ts +1 -1
- package/dist/index.js +57 -6
- package/dist/node.js +57 -6
- package/dist/src/connection/listeners.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
|
+
|
|
5
|
+
### [1.2.2](https://github.com/openfeed-org/sdk-js/compare/1.2.1...1.2.2) (2024-07-12)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* return promise on unsubscribe. ([d37061e](https://github.com/openfeed-org/sdk-js/commit/d37061e4444dde8a65a3636b3e3493fa332dcf4b))
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
|
+
|
|
5
|
+
### [1.2.3](https://github.com/openfeed-org/sdk-js/compare/1.2.2...1.2.3) (2024-12-09)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* Added heartbeat listener. ([960bd7a](https://github.com/openfeed-org/sdk-js/commit/960bd7ad27b0cd1c5dfe9714a315d72fdad588b0))
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
|
+
|
|
5
|
+
## [1.3.0](https://github.com/openfeed-org/sdk-js/compare/1.2.3...1.3.0) (2025-01-08)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* regenarate files from proto to add new properties ([1c7e22f](https://github.com/openfeed-org/sdk-js/commit/1c7e22fa0a06d129a44abff90bdce72e3d1976de))
|
package/CHANGELOG.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
-
### [1.
|
|
5
|
+
### [1.3.1](https://github.com/openfeed-org/sdk-js/compare/1.3.0...1.3.1) (2025-01-08)
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
### Bug Fixes
|
|
9
9
|
|
|
10
|
-
*
|
|
10
|
+
* fix type issues ([926eb95](https://github.com/openfeed-org/sdk-js/commit/926eb95db5d3aefa743610c00531438aa8fa46d8))
|
|
@@ -424,6 +424,7 @@ export interface ClearBook {
|
|
|
424
424
|
export interface InstrumentStatus {
|
|
425
425
|
/** UTC Timestamp, nano seconds since Unix epoch */
|
|
426
426
|
transactionTime: Long;
|
|
427
|
+
/** / Trading status. */
|
|
427
428
|
tradingStatus: InstrumentTradingStatus;
|
|
428
429
|
/** UTC Timestamp, nano seconds since Unix epoch */
|
|
429
430
|
openingTime: Long;
|
|
@@ -431,6 +432,8 @@ export interface InstrumentStatus {
|
|
|
431
432
|
/** / Date only, format 2012-07-04 -> 20120704 */
|
|
432
433
|
tradeDate: number;
|
|
433
434
|
regulationSHOShortSalePriceTest: RegulationSHOShortSalePriceTest;
|
|
435
|
+
/** / Prior trading status for the instrument. */
|
|
436
|
+
priorTradingStatus: InstrumentTradingStatus;
|
|
434
437
|
}
|
|
435
438
|
/**
|
|
436
439
|
* / Best Bid and Offer.
|
|
@@ -31,9 +31,10 @@ export declare enum SubscriptionType {
|
|
|
31
31
|
DEPTH_PRICE = 3,
|
|
32
32
|
DEPTH_ORDER = 4,
|
|
33
33
|
TRADES = 5,
|
|
34
|
-
|
|
34
|
+
CUMULATIVE_VOLUME = 6,
|
|
35
35
|
OHLC = 7,
|
|
36
36
|
OHLC_NON_REGULAR = 8,
|
|
37
|
+
SETTLEMENT = 9,
|
|
37
38
|
UNRECOGNIZED = -1
|
|
38
39
|
}
|
|
39
40
|
/** / Symbol type for the subscription filter. */
|
|
@@ -203,6 +204,10 @@ export interface SubscriptionRequest_Request {
|
|
|
203
204
|
bulkSubscriptionFilter: BulkSubscriptionFilter[];
|
|
204
205
|
/** / Filter for Spread Types */
|
|
205
206
|
spreadTypeFilter: string[];
|
|
207
|
+
/** / Do not send instrument(s) on successful subscription */
|
|
208
|
+
subscriptionDoNotSendInstruments: boolean;
|
|
209
|
+
/** / Do not send market snapshot(s) on successful subscription */
|
|
210
|
+
subscriptionDoNotSendSnapshots: boolean;
|
|
206
211
|
}
|
|
207
212
|
export interface SubscriptionResponse {
|
|
208
213
|
correlationId: Long;
|
|
@@ -240,10 +245,14 @@ export interface ListSubscriptionsResponse_Subscription {
|
|
|
240
245
|
subscriptionId: string;
|
|
241
246
|
symbolId: string;
|
|
242
247
|
marketId: Long;
|
|
243
|
-
|
|
248
|
+
symbolCounts: ListSubscriptionsResponse_SymbolCount[];
|
|
244
249
|
exchange: string;
|
|
245
250
|
root: string;
|
|
246
251
|
}
|
|
252
|
+
export interface ListSubscriptionsResponse_SymbolCount {
|
|
253
|
+
symbol: string;
|
|
254
|
+
count: number;
|
|
255
|
+
}
|
|
247
256
|
export declare const OpenfeedGatewayRequestEncode: {
|
|
248
257
|
encode(message: OpenfeedGatewayRequest, writer?: _m0.Writer): _m0.Writer;
|
|
249
258
|
}, OpenfeedGatewayRequestDecode: {
|
|
@@ -354,3 +363,8 @@ export declare const ListSubscriptionsResponse_SubscriptionEncode: {
|
|
|
354
363
|
}, ListSubscriptionsResponse_SubscriptionDecode: {
|
|
355
364
|
decode(input: _m0.Reader | Uint8Array, length?: number): ListSubscriptionsResponse_Subscription;
|
|
356
365
|
};
|
|
366
|
+
export declare const ListSubscriptionsResponse_SymbolCountEncode: {
|
|
367
|
+
encode(message: ListSubscriptionsResponse_SymbolCount, writer?: _m0.Writer): _m0.Writer;
|
|
368
|
+
}, ListSubscriptionsResponse_SymbolCountDecode: {
|
|
369
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): ListSubscriptionsResponse_SymbolCount;
|
|
370
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.
|
|
1
|
+
export declare const version = "1.3.1";
|
package/dist/index.js
CHANGED
|
@@ -4267,7 +4267,8 @@ function createBaseInstrumentStatus() {
|
|
|
4267
4267
|
openingTime: Long.ZERO,
|
|
4268
4268
|
note: "",
|
|
4269
4269
|
tradeDate: 0,
|
|
4270
|
-
regulationSHOShortSalePriceTest: 0
|
|
4270
|
+
regulationSHOShortSalePriceTest: 0,
|
|
4271
|
+
priorTradingStatus: 0
|
|
4271
4272
|
};
|
|
4272
4273
|
}
|
|
4273
4274
|
const InstrumentStatusDecode = {
|
|
@@ -4314,6 +4315,12 @@ const InstrumentStatusDecode = {
|
|
|
4314
4315
|
}
|
|
4315
4316
|
message.regulationSHOShortSalePriceTest = reader2.int32();
|
|
4316
4317
|
continue;
|
|
4318
|
+
case 15:
|
|
4319
|
+
if (tag !== 120) {
|
|
4320
|
+
break;
|
|
4321
|
+
}
|
|
4322
|
+
message.priorTradingStatus = reader2.int32();
|
|
4323
|
+
continue;
|
|
4317
4324
|
}
|
|
4318
4325
|
if ((tag & 7) === 4 || tag === 0) {
|
|
4319
4326
|
break;
|
|
@@ -7208,9 +7215,10 @@ var SubscriptionType = /* @__PURE__ */ ((SubscriptionType2) => {
|
|
|
7208
7215
|
SubscriptionType2[SubscriptionType2["DEPTH_PRICE"] = 3] = "DEPTH_PRICE";
|
|
7209
7216
|
SubscriptionType2[SubscriptionType2["DEPTH_ORDER"] = 4] = "DEPTH_ORDER";
|
|
7210
7217
|
SubscriptionType2[SubscriptionType2["TRADES"] = 5] = "TRADES";
|
|
7211
|
-
SubscriptionType2[SubscriptionType2["
|
|
7218
|
+
SubscriptionType2[SubscriptionType2["CUMULATIVE_VOLUME"] = 6] = "CUMULATIVE_VOLUME";
|
|
7212
7219
|
SubscriptionType2[SubscriptionType2["OHLC"] = 7] = "OHLC";
|
|
7213
7220
|
SubscriptionType2[SubscriptionType2["OHLC_NON_REGULAR"] = 8] = "OHLC_NON_REGULAR";
|
|
7221
|
+
SubscriptionType2[SubscriptionType2["SETTLEMENT"] = 9] = "SETTLEMENT";
|
|
7214
7222
|
SubscriptionType2[SubscriptionType2["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
7215
7223
|
return SubscriptionType2;
|
|
7216
7224
|
})(SubscriptionType || {});
|
|
@@ -7917,6 +7925,12 @@ const SubscriptionRequest_RequestEncode = {
|
|
|
7917
7925
|
for (const v of message.spreadTypeFilter) {
|
|
7918
7926
|
writer2.uint32(114).string(v);
|
|
7919
7927
|
}
|
|
7928
|
+
if (message.subscriptionDoNotSendInstruments === true) {
|
|
7929
|
+
writer2.uint32(120).bool(message.subscriptionDoNotSendInstruments);
|
|
7930
|
+
}
|
|
7931
|
+
if (message.subscriptionDoNotSendSnapshots === true) {
|
|
7932
|
+
writer2.uint32(128).bool(message.subscriptionDoNotSendSnapshots);
|
|
7933
|
+
}
|
|
7920
7934
|
return writer2;
|
|
7921
7935
|
}
|
|
7922
7936
|
};
|
|
@@ -8120,7 +8134,7 @@ const ListSubscriptionsResponse_SessionDecode = {
|
|
|
8120
8134
|
}
|
|
8121
8135
|
};
|
|
8122
8136
|
function createBaseListSubscriptionsResponse_Subscription() {
|
|
8123
|
-
return { subscriptionId: "", symbolId: "", marketId: Long.ZERO,
|
|
8137
|
+
return { subscriptionId: "", symbolId: "", marketId: Long.ZERO, symbolCounts: [], exchange: "", root: "" };
|
|
8124
8138
|
}
|
|
8125
8139
|
const ListSubscriptionsResponse_SubscriptionDecode = {
|
|
8126
8140
|
decode(input, length) {
|
|
@@ -8152,7 +8166,7 @@ const ListSubscriptionsResponse_SubscriptionDecode = {
|
|
|
8152
8166
|
if (tag !== 34) {
|
|
8153
8167
|
break;
|
|
8154
8168
|
}
|
|
8155
|
-
message.
|
|
8169
|
+
message.symbolCounts.push(ListSubscriptionsResponse_SymbolCountDecode.decode(reader2, reader2.uint32()));
|
|
8156
8170
|
continue;
|
|
8157
8171
|
case 10:
|
|
8158
8172
|
if (tag !== 82) {
|
|
@@ -8175,6 +8189,38 @@ const ListSubscriptionsResponse_SubscriptionDecode = {
|
|
|
8175
8189
|
return message;
|
|
8176
8190
|
}
|
|
8177
8191
|
};
|
|
8192
|
+
function createBaseListSubscriptionsResponse_SymbolCount() {
|
|
8193
|
+
return { symbol: "", count: 0 };
|
|
8194
|
+
}
|
|
8195
|
+
const ListSubscriptionsResponse_SymbolCountDecode = {
|
|
8196
|
+
decode(input, length) {
|
|
8197
|
+
const reader2 = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
8198
|
+
let end2 = length === void 0 ? reader2.len : reader2.pos + length;
|
|
8199
|
+
const message = createBaseListSubscriptionsResponse_SymbolCount();
|
|
8200
|
+
while (reader2.pos < end2) {
|
|
8201
|
+
const tag = reader2.uint32();
|
|
8202
|
+
switch (tag >>> 3) {
|
|
8203
|
+
case 1:
|
|
8204
|
+
if (tag !== 10) {
|
|
8205
|
+
break;
|
|
8206
|
+
}
|
|
8207
|
+
message.symbol = reader2.string();
|
|
8208
|
+
continue;
|
|
8209
|
+
case 2:
|
|
8210
|
+
if (tag !== 16) {
|
|
8211
|
+
break;
|
|
8212
|
+
}
|
|
8213
|
+
message.count = reader2.sint32();
|
|
8214
|
+
continue;
|
|
8215
|
+
}
|
|
8216
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
8217
|
+
break;
|
|
8218
|
+
}
|
|
8219
|
+
reader2.skipType(tag & 7);
|
|
8220
|
+
}
|
|
8221
|
+
return message;
|
|
8222
|
+
}
|
|
8223
|
+
};
|
|
8178
8224
|
if (_m0.util.Long !== Long) {
|
|
8179
8225
|
_m0.util.Long = Long;
|
|
8180
8226
|
_m0.configure();
|
|
@@ -8213,7 +8259,7 @@ class ResolutionSource {
|
|
|
8213
8259
|
return this.onError;
|
|
8214
8260
|
}
|
|
8215
8261
|
}
|
|
8216
|
-
const version = "1.
|
|
8262
|
+
const version = "1.3.1";
|
|
8217
8263
|
const send = (socket, message) => {
|
|
8218
8264
|
socket.send(OpenfeedGatewayRequestEncode.encode(toT(message)).finish());
|
|
8219
8265
|
};
|
|
@@ -8294,6 +8340,7 @@ class OpenFeedConnection {
|
|
|
8294
8340
|
const messages = receive(event);
|
|
8295
8341
|
for (const message of messages) {
|
|
8296
8342
|
if (message.heartBeat) {
|
|
8343
|
+
this.listeners.onHeartBeat(message.heartBeat);
|
|
8297
8344
|
continue;
|
|
8298
8345
|
}
|
|
8299
8346
|
if (((_b = (_a = message.logoutResponse) == null ? void 0 : _a.status) == null ? void 0 : _b.result) === Result.DUPLICATE_LOGIN) {
|
|
@@ -8376,7 +8423,9 @@ class OpenFeedConnection {
|
|
|
8376
8423
|
snapshotIntervalSeconds,
|
|
8377
8424
|
instrumentType: [],
|
|
8378
8425
|
bulkSubscriptionFilter: [],
|
|
8379
|
-
spreadTypeFilter: []
|
|
8426
|
+
spreadTypeFilter: [],
|
|
8427
|
+
subscriptionDoNotSendInstruments: false,
|
|
8428
|
+
subscriptionDoNotSendSnapshots: false
|
|
8380
8429
|
};
|
|
8381
8430
|
if (symbols) {
|
|
8382
8431
|
for (const symbol of symbols) {
|
|
@@ -8892,6 +8941,8 @@ class OpenFeedListeners {
|
|
|
8892
8941
|
});
|
|
8893
8942
|
__publicField(this, "onMessageWithMetadata", () => {
|
|
8894
8943
|
});
|
|
8944
|
+
__publicField(this, "onHeartBeat", () => {
|
|
8945
|
+
});
|
|
8895
8946
|
this.onMessage = this.addDetails;
|
|
8896
8947
|
}
|
|
8897
8948
|
/* eslint-enable class-methods-use-this */
|
package/dist/node.js
CHANGED
|
@@ -7885,7 +7885,8 @@ function createBaseInstrumentStatus() {
|
|
|
7885
7885
|
openingTime: long_default.ZERO,
|
|
7886
7886
|
note: "",
|
|
7887
7887
|
tradeDate: 0,
|
|
7888
|
-
regulationSHOShortSalePriceTest: 0
|
|
7888
|
+
regulationSHOShortSalePriceTest: 0,
|
|
7889
|
+
priorTradingStatus: 0
|
|
7889
7890
|
};
|
|
7890
7891
|
}
|
|
7891
7892
|
var InstrumentStatusDecode = {
|
|
@@ -7932,6 +7933,12 @@ var InstrumentStatusDecode = {
|
|
|
7932
7933
|
}
|
|
7933
7934
|
message.regulationSHOShortSalePriceTest = reader.int32();
|
|
7934
7935
|
continue;
|
|
7936
|
+
case 15:
|
|
7937
|
+
if (tag !== 120) {
|
|
7938
|
+
break;
|
|
7939
|
+
}
|
|
7940
|
+
message.priorTradingStatus = reader.int32();
|
|
7941
|
+
continue;
|
|
7935
7942
|
}
|
|
7936
7943
|
if ((tag & 7) === 4 || tag === 0) {
|
|
7937
7944
|
break;
|
|
@@ -10828,9 +10835,10 @@ var SubscriptionType = /* @__PURE__ */ ((SubscriptionType2) => {
|
|
|
10828
10835
|
SubscriptionType2[SubscriptionType2["DEPTH_PRICE"] = 3] = "DEPTH_PRICE";
|
|
10829
10836
|
SubscriptionType2[SubscriptionType2["DEPTH_ORDER"] = 4] = "DEPTH_ORDER";
|
|
10830
10837
|
SubscriptionType2[SubscriptionType2["TRADES"] = 5] = "TRADES";
|
|
10831
|
-
SubscriptionType2[SubscriptionType2["
|
|
10838
|
+
SubscriptionType2[SubscriptionType2["CUMULATIVE_VOLUME"] = 6] = "CUMULATIVE_VOLUME";
|
|
10832
10839
|
SubscriptionType2[SubscriptionType2["OHLC"] = 7] = "OHLC";
|
|
10833
10840
|
SubscriptionType2[SubscriptionType2["OHLC_NON_REGULAR"] = 8] = "OHLC_NON_REGULAR";
|
|
10841
|
+
SubscriptionType2[SubscriptionType2["SETTLEMENT"] = 9] = "SETTLEMENT";
|
|
10834
10842
|
SubscriptionType2[SubscriptionType2["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
10835
10843
|
return SubscriptionType2;
|
|
10836
10844
|
})(SubscriptionType || {});
|
|
@@ -11537,6 +11545,12 @@ var SubscriptionRequest_RequestEncode = {
|
|
|
11537
11545
|
for (const v of message.spreadTypeFilter) {
|
|
11538
11546
|
writer.uint32(114).string(v);
|
|
11539
11547
|
}
|
|
11548
|
+
if (message.subscriptionDoNotSendInstruments === true) {
|
|
11549
|
+
writer.uint32(120).bool(message.subscriptionDoNotSendInstruments);
|
|
11550
|
+
}
|
|
11551
|
+
if (message.subscriptionDoNotSendSnapshots === true) {
|
|
11552
|
+
writer.uint32(128).bool(message.subscriptionDoNotSendSnapshots);
|
|
11553
|
+
}
|
|
11540
11554
|
return writer;
|
|
11541
11555
|
}
|
|
11542
11556
|
};
|
|
@@ -11740,7 +11754,7 @@ var ListSubscriptionsResponse_SessionDecode = {
|
|
|
11740
11754
|
}
|
|
11741
11755
|
};
|
|
11742
11756
|
function createBaseListSubscriptionsResponse_Subscription() {
|
|
11743
|
-
return { subscriptionId: "", symbolId: "", marketId: long_default.ZERO,
|
|
11757
|
+
return { subscriptionId: "", symbolId: "", marketId: long_default.ZERO, symbolCounts: [], exchange: "", root: "" };
|
|
11744
11758
|
}
|
|
11745
11759
|
var ListSubscriptionsResponse_SubscriptionDecode = {
|
|
11746
11760
|
decode(input, length) {
|
|
@@ -11772,7 +11786,7 @@ var ListSubscriptionsResponse_SubscriptionDecode = {
|
|
|
11772
11786
|
if (tag !== 34) {
|
|
11773
11787
|
break;
|
|
11774
11788
|
}
|
|
11775
|
-
message.
|
|
11789
|
+
message.symbolCounts.push(ListSubscriptionsResponse_SymbolCountDecode.decode(reader, reader.uint32()));
|
|
11776
11790
|
continue;
|
|
11777
11791
|
case 10:
|
|
11778
11792
|
if (tag !== 82) {
|
|
@@ -11795,6 +11809,38 @@ var ListSubscriptionsResponse_SubscriptionDecode = {
|
|
|
11795
11809
|
return message;
|
|
11796
11810
|
}
|
|
11797
11811
|
};
|
|
11812
|
+
function createBaseListSubscriptionsResponse_SymbolCount() {
|
|
11813
|
+
return { symbol: "", count: 0 };
|
|
11814
|
+
}
|
|
11815
|
+
var ListSubscriptionsResponse_SymbolCountDecode = {
|
|
11816
|
+
decode(input, length) {
|
|
11817
|
+
const reader = input instanceof import_minimal3.default.Reader ? input : import_minimal3.default.Reader.create(input);
|
|
11818
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
11819
|
+
const message = createBaseListSubscriptionsResponse_SymbolCount();
|
|
11820
|
+
while (reader.pos < end) {
|
|
11821
|
+
const tag = reader.uint32();
|
|
11822
|
+
switch (tag >>> 3) {
|
|
11823
|
+
case 1:
|
|
11824
|
+
if (tag !== 10) {
|
|
11825
|
+
break;
|
|
11826
|
+
}
|
|
11827
|
+
message.symbol = reader.string();
|
|
11828
|
+
continue;
|
|
11829
|
+
case 2:
|
|
11830
|
+
if (tag !== 16) {
|
|
11831
|
+
break;
|
|
11832
|
+
}
|
|
11833
|
+
message.count = reader.sint32();
|
|
11834
|
+
continue;
|
|
11835
|
+
}
|
|
11836
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
11837
|
+
break;
|
|
11838
|
+
}
|
|
11839
|
+
reader.skipType(tag & 7);
|
|
11840
|
+
}
|
|
11841
|
+
return message;
|
|
11842
|
+
}
|
|
11843
|
+
};
|
|
11798
11844
|
if (import_minimal3.default.util.Long !== long_default) {
|
|
11799
11845
|
import_minimal3.default.util.Long = long_default;
|
|
11800
11846
|
import_minimal3.default.configure();
|
|
@@ -11837,7 +11883,7 @@ var ResolutionSource = class {
|
|
|
11837
11883
|
};
|
|
11838
11884
|
|
|
11839
11885
|
// generated/version.ts
|
|
11840
|
-
var version = "1.
|
|
11886
|
+
var version = "1.3.1";
|
|
11841
11887
|
|
|
11842
11888
|
// src/connection/connection.ts
|
|
11843
11889
|
var send = (socket, message) => {
|
|
@@ -11928,6 +11974,7 @@ var OpenFeedConnection = class {
|
|
|
11928
11974
|
const messages = receive(event);
|
|
11929
11975
|
for (const message of messages) {
|
|
11930
11976
|
if (message.heartBeat) {
|
|
11977
|
+
this.listeners.onHeartBeat(message.heartBeat);
|
|
11931
11978
|
continue;
|
|
11932
11979
|
}
|
|
11933
11980
|
if (((_b = (_a = message.logoutResponse) == null ? void 0 : _a.status) == null ? void 0 : _b.result) === 115 /* DUPLICATE_LOGIN */) {
|
|
@@ -12028,7 +12075,9 @@ var OpenFeedConnection = class {
|
|
|
12028
12075
|
snapshotIntervalSeconds,
|
|
12029
12076
|
instrumentType: [],
|
|
12030
12077
|
bulkSubscriptionFilter: [],
|
|
12031
|
-
spreadTypeFilter: []
|
|
12078
|
+
spreadTypeFilter: [],
|
|
12079
|
+
subscriptionDoNotSendInstruments: false,
|
|
12080
|
+
subscriptionDoNotSendSnapshots: false
|
|
12032
12081
|
};
|
|
12033
12082
|
if (symbols) {
|
|
12034
12083
|
for (const symbol of symbols) {
|
|
@@ -12521,6 +12570,8 @@ var OpenFeedListeners = class {
|
|
|
12521
12570
|
};
|
|
12522
12571
|
onMessageWithMetadata = () => {
|
|
12523
12572
|
};
|
|
12573
|
+
onHeartBeat = () => {
|
|
12574
|
+
};
|
|
12524
12575
|
/* eslint-enable class-methods-use-this */
|
|
12525
12576
|
};
|
|
12526
12577
|
export {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { OpenfeedGatewayMessage } from "@gen/openfeed_api";
|
|
2
2
|
import { InstrumentDefinition } from "@gen/openfeed_instrument";
|
|
3
|
+
import { HeartBeat } from "@gen/openfeed";
|
|
3
4
|
import { IOpenFeedConnection } from "./connection_interfaces";
|
|
4
5
|
export declare class OpenFeedListeners {
|
|
5
6
|
private readonly instrumentBySymbol;
|
|
@@ -11,4 +12,5 @@ export declare class OpenFeedListeners {
|
|
|
11
12
|
onDisconnected: () => void | Promise<void>;
|
|
12
13
|
onMessage: (message: OpenfeedGatewayMessage) => void | Promise<void>;
|
|
13
14
|
onMessageWithMetadata: (message: OpenfeedGatewayMessage, symbolNames: string[], instrument?: InstrumentDefinition) => void | Promise<void>;
|
|
15
|
+
onHeartBeat: (heartBeat: HeartBeat) => void | Promise<void>;
|
|
14
16
|
}
|