-
Notifications
You must be signed in to change notification settings - Fork 3
/
models.go
69 lines (56 loc) · 1.25 KB
/
models.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
package cryptowatch
import (
"time"
)
type Allowance struct {
Cost int64
Remaining int64
}
type Market struct {
Exchange string `json:"exchange"`
CurrencyPair string `json:"currencyPair"`
}
func (m *Market) toString() string {
return m.Exchange + ":" + m.CurrencyPair
}
type MarketsPrices map[string]float64
type MarketsSummaries map[string]Summary
type Price struct {
Last float64 `json:"last"`
High float64 `json:"high"`
Low float64 `json:"low"`
Change Change `json:"change"`
}
type Change struct {
Percentage float64 `json:"percentage"`
Absolute float64 `json:"absolute"`
}
type Summary struct {
Price Price `json:"price"`
Volume float64 `json:"volume"`
}
type Trade struct {
ID int64 `json:"id"`
Timestamp int64 `json:"timestamp"`
Time time.Time
Price float64 `json:"price"`
Amount float64`json:"amout"`
}
type Book struct {
Price float64 `json:"price"`
Amount float64 `json:"amount"`
}
type OrderBook struct {
Asks []Book `json:"asks"`
Bids []Book `json:"bids"`
}
type OHLC map[int64][]OHLCSummary
type OHLCSummary struct {
CloseTimestamp int64
CloseTime time.Time
OpenPrice float64
HighPrice float64
LowPrice float64
ClosePrice float64
Volume float64
}