forked from go-numb/go-ftx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
get-order-trigger-histories.go
63 lines (52 loc) · 1.76 KB
/
get-order-trigger-histories.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
package orders
import (
"net/http"
"time"
"github.com/google/go-querystring/query"
)
type RequestForOrderTriggerHistories struct {
ProductCode string `url:"market,omitempty"`
Type string `url:"type,omitempty"`
Side string `url:"side,omitempty"`
OrderType string `url:"orderType,omitempty"`
Limit int `url:"limit,omitempty"`
Start int64 `url:"start_time,omitempty"`
End int64 `url:"end_time,omitempty"`
}
type ResponseForOrderTriggerHistories []TriggerHistory
type TriggerHistory struct {
Status string `json:"status"`
Error string `json:"error"`
Future string `json:"future"`
Market string `json:"market"`
Type string `json:"type"`
OrderType string `json:"orderType"`
OrderStatus string `json:"orderStatus"`
Side string `json:"side"`
OrderPrice float64 `json:"orderPrice"`
TriggerPrice float64 `json:"triggerPrice"`
AvgFillPrice float64 `json:"avgFillPrice"`
TrailStart float64 `json:"trailStart"`
TrailValue float64 `json:"trailValue"`
ID int `json:"id"`
OrderID int `json:"orderId"`
Size int `json:"size"`
FilledSize int `json:"filledSize"`
RetryUntilFilled bool `json:"retryUntilFilled"`
ReduceOnly bool `json:"reduceOnly"`
TriggeredAt time.Time `json:"triggeredAt"`
CreatedAt time.Time `json:"createdAt"`
}
func (req *RequestForOrderTriggerHistories) Path() string {
return "/conditional_orders/history"
}
func (req *RequestForOrderTriggerHistories) Method() string {
return http.MethodGet
}
func (req *RequestForOrderTriggerHistories) Query() string {
value, _ := query.Values(req)
return value.Encode()
}
func (req *RequestForOrderTriggerHistories) Payload() []byte {
return nil
}