forked from go-numb/go-ftx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
redemption.go
43 lines (35 loc) · 881 Bytes
/
redemption.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
package leveraged
import (
"fmt"
"net/http"
"time"
)
type RequestForRedemptionLvToken struct {
ProductCode string `json:"-"`
// to body
Size string `json:"size"`
}
type ResponseForRedemptionLvToken struct {
Token string `json:"token"`
Size float64 `json:"size"`
ProjectedProceeds float64 `json:"projectedProceeds"`
Pending bool `json:"pending"`
RequestedAt time.Time `json:"requestedAt"`
ID int `json:"id"`
}
func (req *RequestForRedemptionLvToken) Path() string {
return fmt.Sprintf("/lt/%s/redeem", req.ProductCode)
}
func (req *RequestForRedemptionLvToken) Method() string {
return http.MethodPost
}
func (req *RequestForRedemptionLvToken) Query() string {
return ""
}
func (req *RequestForRedemptionLvToken) Payload() []byte {
b, err := json.Marshal(req)
if err != nil {
return nil
}
return b
}