@evedex/exchange-api 1.0.64 → 1.0.65
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { utils as cryptoUtils } from "@evedex/exchange-crypto";
|
|
2
|
-
import { Callback, CentrifugeClient, MarketDepth, MarketDepthLevel, MatcherState, Order, OrderFillFee, Position, TpSl, OrderBookRoundPrices, type RecentTrade, type InstrumentUpdateEvent, Transfer, type OrderFill } from "./utils";
|
|
2
|
+
import { Callback, CentrifugeClient, MarketDepth, MarketDepthLevel, MatcherState, Order, OrderFillFee, Position, TpSl, OrderBookRoundPrices, type RecentTrade, type InstrumentUpdateEvent, Transfer, type OrderFill, type SubscriptionOptions } from "./utils";
|
|
3
3
|
export interface HeartbeatEvent {
|
|
4
4
|
t: number;
|
|
5
5
|
}
|
|
@@ -106,8 +106,8 @@ export declare class ExchangeWsGateway {
|
|
|
106
106
|
constructor(options: ExchangeWsGatewayOptions);
|
|
107
107
|
protected listenChannel<T>(name: string, recoverable: boolean, handler: Callback<{
|
|
108
108
|
data: T;
|
|
109
|
-
}>): void;
|
|
110
|
-
protected unListenChannel(name: string, recoverable: boolean): void;
|
|
109
|
+
}>, options?: Partial<SubscriptionOptions>): void;
|
|
110
|
+
protected unListenChannel(name: string, recoverable: boolean, options?: Partial<SubscriptionOptions>): void;
|
|
111
111
|
onHeartbeat: import("./utils").Signal<HeartbeatEvent>;
|
|
112
112
|
listenHeartbeat(): void;
|
|
113
113
|
unListenHeartbeat(): void;
|
|
@@ -25,18 +25,18 @@ class ExchangeWsGateway {
|
|
|
25
25
|
this.onFundingRateUpdate = (0, utils_1.signal)();
|
|
26
26
|
this.onInstrumentUpdate = (0, utils_1.signal)();
|
|
27
27
|
}
|
|
28
|
-
listenChannel(name, recoverable, handler) {
|
|
28
|
+
listenChannel(name, recoverable, handler, options = {}) {
|
|
29
29
|
if (this.listenedChannels.has(name))
|
|
30
30
|
return;
|
|
31
|
-
const channel = this.options.wsClient.assignChannel(name, { recoverable });
|
|
31
|
+
const channel = this.options.wsClient.assignChannel(name, Object.assign(Object.assign({}, options), { recoverable }));
|
|
32
32
|
channel.onPublication(handler);
|
|
33
33
|
channel.subscribe();
|
|
34
34
|
this.listenedChannels.add(name);
|
|
35
35
|
}
|
|
36
|
-
unListenChannel(name, recoverable) {
|
|
36
|
+
unListenChannel(name, recoverable, options = {}) {
|
|
37
37
|
if (!this.listenedChannels.has(name))
|
|
38
38
|
return;
|
|
39
|
-
this.options.wsClient.assignChannel(name, { recoverable }).unsubscribe();
|
|
39
|
+
this.options.wsClient.assignChannel(name, Object.assign(Object.assign({}, options), { recoverable })).unsubscribe();
|
|
40
40
|
this.listenedChannels.delete(name);
|
|
41
41
|
}
|
|
42
42
|
listenHeartbeat() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { utils as cryptoUtils } from "@evedex/exchange-crypto";
|
|
2
|
-
import { Callback, CentrifugeClient, MarketDepth, MarketDepthLevel, MatcherState, Order, OrderFillFee, Position, TpSl, OrderBookRoundPrices, type RecentTrade, type InstrumentUpdateEvent, Transfer, type OrderFill } from "./utils";
|
|
2
|
+
import { Callback, CentrifugeClient, MarketDepth, MarketDepthLevel, MatcherState, Order, OrderFillFee, Position, TpSl, OrderBookRoundPrices, type RecentTrade, type InstrumentUpdateEvent, Transfer, type OrderFill, type SubscriptionOptions } from "./utils";
|
|
3
3
|
export interface HeartbeatEvent {
|
|
4
4
|
t: number;
|
|
5
5
|
}
|
|
@@ -106,8 +106,8 @@ export declare class ExchangeWsGateway {
|
|
|
106
106
|
constructor(options: ExchangeWsGatewayOptions);
|
|
107
107
|
protected listenChannel<T>(name: string, recoverable: boolean, handler: Callback<{
|
|
108
108
|
data: T;
|
|
109
|
-
}>): void;
|
|
110
|
-
protected unListenChannel(name: string, recoverable: boolean): void;
|
|
109
|
+
}>, options?: Partial<SubscriptionOptions>): void;
|
|
110
|
+
protected unListenChannel(name: string, recoverable: boolean, options?: Partial<SubscriptionOptions>): void;
|
|
111
111
|
onHeartbeat: import("./utils").Signal<HeartbeatEvent>;
|
|
112
112
|
listenHeartbeat(): void;
|
|
113
113
|
unListenHeartbeat(): void;
|
|
@@ -5,18 +5,18 @@ export class ExchangeWsGateway {
|
|
|
5
5
|
constructor(options) {
|
|
6
6
|
this.options = options;
|
|
7
7
|
}
|
|
8
|
-
listenChannel(name, recoverable, handler) {
|
|
8
|
+
listenChannel(name, recoverable, handler, options = {}) {
|
|
9
9
|
if (this.listenedChannels.has(name))
|
|
10
10
|
return;
|
|
11
|
-
const channel = this.options.wsClient.assignChannel(name, { recoverable });
|
|
11
|
+
const channel = this.options.wsClient.assignChannel(name, { ...options, recoverable });
|
|
12
12
|
channel.onPublication(handler);
|
|
13
13
|
channel.subscribe();
|
|
14
14
|
this.listenedChannels.add(name);
|
|
15
15
|
}
|
|
16
|
-
unListenChannel(name, recoverable) {
|
|
16
|
+
unListenChannel(name, recoverable, options = {}) {
|
|
17
17
|
if (!this.listenedChannels.has(name))
|
|
18
18
|
return;
|
|
19
|
-
this.options.wsClient.assignChannel(name, { recoverable }).unsubscribe();
|
|
19
|
+
this.options.wsClient.assignChannel(name, { ...options, recoverable }).unsubscribe();
|
|
20
20
|
this.listenedChannels.delete(name);
|
|
21
21
|
}
|
|
22
22
|
// Market
|