/
responsews.go
85 lines (79 loc) · 2.79 KB
/
responsews.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package bitstamp
// LiveTickerChannel object to map messages from live_trades_[currency_pair] channel
type LiveTickerChannel struct {
Data struct {
ID int `json:"id"`
Timestamp string `json:"timestamp"`
Amount float64 `json:"amount"`
AmountStr string `json:"amount_str"`
Price float64 `json:"price"`
PriceStr string `json:"price_str"`
Type int `json:"type"`
Microtimestamp string `json:"microtimestamp"`
BuyOrderID int64 `json:"buy_order_id"`
SellOrderID int64 `json:"sell_order_id"`
} `json:"data"`
Channel string `json:"channel"`
Event string `json:"event"`
}
// LiveOrdersChannel object to map messages from live_orders_[currency_pair] channel
type LiveOrdersChannel struct {
Data struct {
ID int64 `json:"id"`
IDStr string `json:"id_str"`
OrderType int `json:"order_type"`
Datetime string `json:"datetime"`
Microtimestamp string `json:"microtimestamp"`
Amount float64 `json:"amount"`
AmountStr string `json:"amount_str"`
Price float64 `json:"price"`
PriceStr string `json:"price_str"`
} `json:"data"`
Channel string `json:"channel"`
Event string `json:"event"`
}
// LiveOrderBookChannel object to map messages from order_book_[currency_pair] channel
type LiveOrderBookChannel struct {
Data struct {
Timestamp string `json:"timestamp"`
Microtimestamp string `json:"microtimestamp"`
// List of top 100 bids
Bids [][]string `json:"bids"`
// List of top 100 asks
Asks [][]string `json:"asks"`
} `json:"data"`
Channel string `json:"channel"`
Event string `json:"event"`
}
// LiveDetailOrderBookChannel object to map messages from detail_order_book_[currency_pair] channel
type LiveDetailOrderBookChannel struct {
Data struct {
Timestamp string `json:"timestamp"`
Microtimestamp string `json:"microtimestamp"`
// List of top 100 bids [price, amount, order id].
Bids [][]string `json:"bids"`
// List of top 100 asks [price, amount, order id].
Asks [][]string `json:"asks"`
} `json:"data"`
Channel string `json:"channel"`
Event string `json:"event"`
}
// LiveFullOrderBook object to map messages from diff_order_book_[currency_pair] channel
type LiveFullOrderBook struct {
Data struct {
Timestamp string `json:"timestamp"`
Microtimestamp string `json:"microtimestamp"`
// List of changed bids since last broadcast.
Bids [][]string `json:"bids"`
// List of changed asks since last broadcast.
Asks [][]string `json:"asks"`
} `json:"data"`
Channel string `json:"channel"`
Event string `json:"event"`
}
// WebSocketMessage object to map any message
type WebSocketMessage struct {
Event string `json:"event"`
Channel string `json:"channel"`
Data interface{} `json:"data"`
}