forked from go-numb/go-ftx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
get-open-order.go
71 lines (58 loc) · 1.71 KB
/
get-open-order.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
package orders
import (
"net/http"
"time"
"github.com/google/go-querystring/query"
)
type RequestForOpenOrder struct {
ProductCode string `url:"market,omitempty"`
}
type ResponseForOpenOrder []OpenOrder
type OpenOrder struct {
Type string `json:"type"`
Market string `json:"market"`
Future string `json:"future"`
ClientID string `json:"clientId"`
Status string `json:"status"`
Side string `json:"side"`
Price float64 `json:"price"`
AvgFillPrice float64 `json:"avgFillPrice"`
Size float64 `json:"size"`
FilledSize float64 `json:"filledSize"`
RemainingSize float64 `json:"remainingSize"`
ID int `json:"id"`
ReduceOnly bool `json:"reduceOnly"`
Ioc bool `json:"ioc"`
PostOnly bool `json:"postOnly"`
CreatedAt time.Time `json:"createdAt"`
}
type Order struct {
ID int `json:"id"`
ClientID string `json:"clientId"`
Market string `json:"market"`
Type string `json:"type"`
Side string `json:"side"`
Size float64 `json:"size"`
Price float64 `json:"price"`
ReduceOnly bool `json:"reduceOnly"`
Ioc bool `json:"ioc"`
PostOnly bool `json:"postOnly"`
Status string `json:"status"`
FilledSize float64 `json:"filledSize"`
RemainingSize float64 `json:"remainingSize"`
AvgFillPrice float64 `json:"avgFillPrice"`
CreatedAt time.Time `json:"createdAt"`
}
func (req *RequestForOpenOrder) Path() string {
return "/orders"
}
func (req *RequestForOpenOrder) Method() string {
return http.MethodGet
}
func (req *RequestForOpenOrder) Query() string {
value, _ := query.Values(req)
return value.Encode()
}
func (req *RequestForOpenOrder) Payload() []byte {
return nil
}