forked from thrasher-corp/gocryptotrader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
btcmarkets_types.go
108 lines (98 loc) · 3.47 KB
/
btcmarkets_types.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
package btcmarkets
// Response is the genralized response type
type Response struct {
Success bool `json:"success"`
ErrorCode int `json:"errorCode"`
ErrorMessage string `json:"errorMessage"`
ID int `json:"id"`
Responses []struct {
Success bool `json:"success"`
ErrorCode int `json:"errorCode"`
ErrorMessage string `json:"errorMessage"`
ID int64 `json:"id"`
}
ClientRequestID string `json:"clientRequestId"`
Orders []Order `json:"orders"`
Status string `json:"status"`
}
// Ticker holds ticker information
type Ticker struct {
BestBID float64 `json:"bestBid"`
BestAsk float64 `json:"bestAsk"`
LastPrice float64 `json:"lastPrice"`
Currency string `json:"currency"`
Instrument string `json:"instrument"`
Timestamp int64 `json:"timestamp"`
Volume float64 `json:"volume24h"`
}
// Orderbook holds current orderbook information returned from the exchange
type Orderbook struct {
Currency string `json:"currency"`
Instrument string `json:"instrument"`
Timestamp int64 `json:"timestamp"`
Asks [][]float64 `json:"asks"`
Bids [][]float64 `json:"bids"`
}
// Trade holds trade information
type Trade struct {
TradeID int64 `json:"tid"`
Amount float64 `json:"amount"`
Price float64 `json:"price"`
Date int64 `json:"date"`
}
// OrderToGo holds order information to be sent to the exchange
type OrderToGo struct {
Currency string `json:"currency"`
Instrument string `json:"instrument"`
Price int64 `json:"price"`
Volume int64 `json:"volume"`
OrderSide string `json:"orderSide"`
OrderType string `json:"ordertype"`
ClientRequestID string `json:"clientRequestId"`
}
// Order holds order information
type Order struct {
ID int64 `json:"id"`
Currency string `json:"currency"`
Instrument string `json:"instrument"`
OrderSide string `json:"orderSide"`
OrderType string `json:"ordertype"`
CreationTime float64 `json:"creationTime"`
Status string `json:"status"`
ErrorMessage string `json:"errorMessage"`
Price float64 `json:"price"`
Volume float64 `json:"volume"`
OpenVolume float64 `json:"openVolume"`
ClientRequestID string `json:"clientRequestId"`
Trades []TradeResponse `json:"trades"`
}
// TradeResponse holds trade information
type TradeResponse struct {
ID int64 `json:"id"`
CreationTime float64 `json:"creationTime"`
Description string `json:"description"`
Price float64 `json:"price"`
Volume float64 `json:"volume"`
Fee float64 `json:"fee"`
}
// AccountBalance holds account balance details
type AccountBalance struct {
Balance float64 `json:"balance"`
PendingFunds float64 `json:"pendingFunds"`
Currency string `json:"currency"`
}
// WithdrawRequestCrypto is a generalized withdraw request type
type WithdrawRequestCrypto struct {
Amount int64 `json:"amount"`
Currency string `json:"currency"`
Address string `json:"address"`
}
// WithdrawRequestAUD is a generalized withdraw request type
type WithdrawRequestAUD struct {
Amount int64 `json:"amount"`
Currency string `json:"currency"`
AccountName string `json:"accountName"`
AccountNumber string `json:"accountNumber"`
BankName string `json:"bankName"`
BSBNumber string `json:"bsbNumber"`
}