-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsubscriptions.go
46 lines (41 loc) · 1.25 KB
/
subscriptions.go
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
package shrimpygo
const (
ChannelBBO = "bbo"
ChannelOrderBook = "orderbook"
ChannelTrades = "trade"
ChannelOrders = "orders"
)
// BBOSubs returns a subscription of channel 'bbo'. Subscription's type will be set by Subscribe/Unsubscribe methods of
// WSConnection instance.
func BBOSubs(exchange, pair string) Subscription {
return Subscription{
Exchange: exchange,
Pair: pair,
Channel: ChannelBBO,
}
}
// OrderBookSubs returns a subscription of channel 'orderbook'. Subscription's type will be set by Subscribe/Unsubscribe methods of
// WSConnection instance.
func OrderBookSubs(exchange, pair string) Subscription {
return Subscription{
Exchange: exchange,
Pair: pair,
Channel: ChannelOrderBook,
}
}
// TradesSubs returns a subscription of channel 'trade'. Subscription's type will be set by Subscribe/Unsubscribe methods of
// WSConnection instance.
func TradesSubs(exchange, pair string) Subscription {
return Subscription{
Exchange: exchange,
Pair: pair,
Channel: ChannelTrades,
}
}
// OrdersSubs returns a subscription of channel 'orders'. Subscription's type will be set by Subscribe/Unsubscribe methods of
// WSConnection instance.
func OrdersSubs() Subscription {
return Subscription{
Channel: ChannelOrders,
}
}