This repository has been archived by the owner on Sep 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 186
/
Ticker.ts
64 lines (62 loc) · 1.53 KB
/
Ticker.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
export class Ticker {
public exchange: string;
public base: string;
public quote: string;
public timestamp: number;
public sequenceId: number;
public last: string;
public open: string;
public high: string;
public low: string;
public volume: string;
public quoteVolume: string;
public change: string;
public changePercent: string;
public bid: string;
public bidVolume: string;
public ask: string;
public askVolume: string;
constructor({
exchange,
base,
quote,
timestamp,
sequenceId,
last,
open,
high,
low,
volume,
quoteVolume,
change,
changePercent,
bid,
bidVolume,
ask,
askVolume,
}: Partial<Ticker>) {
this.exchange = exchange;
this.base = base;
this.quote = quote;
this.timestamp = timestamp;
this.sequenceId = sequenceId;
this.last = last;
this.open = open;
this.high = high;
this.low = low;
this.volume = volume;
this.quoteVolume = quoteVolume;
this.change = change;
this.changePercent = changePercent;
this.bid = bid;
this.bidVolume = bidVolume;
this.ask = ask;
this.askVolume = askVolume;
}
/**
* @deprecated use Market object (second argument to each event) to determine exchange and trade pair
*/
public get fullId() {
return `${this.exchange}:${this.base}/${this.quote}`;
}
}