forked from go-numb/go-ftx
/
fills.go
46 lines (37 loc) · 981 Bytes
/
fills.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
package options
import (
"net/http"
"time"
"github.com/google/go-querystring/query"
)
type RequestForOpFills struct {
Limit int `url:"limit,omitempty"`
Start int64 `url:"start_time,omitempty"`
End int64 `url:"end_time,omitempty"`
}
type ResponseForOpFills []OpTrade
type OpFill struct {
ID int `json:"id"`
Liquidity string `json:"liquidity"`
Side string `json:"side"`
Price float64 `json:"price"`
QuoteID float64 `json:"quoteId"`
Size float64 `json:"size"`
Fee float64 `json:"fee"`
FeeRate float64 `json:"feeRate"`
Option Option `json:"option"`
Time time.Time `json:"time"`
}
func (req *RequestForOpFills) Path() string {
return "/options/fills"
}
func (req *RequestForOpFills) Method() string {
return http.MethodGet
}
func (req *RequestForOpFills) Query() string {
value, _ := query.Values(req)
return value.Encode()
}
func (req *RequestForOpFills) Payload() []byte {
return nil
}