-
Notifications
You must be signed in to change notification settings - Fork 38
/
spot_leverage.go
72 lines (66 loc) · 2.11 KB
/
spot_leverage.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
package bybit_connector
import (
"context"
"github.com/wuhewuhe/bybit.go.api/handlers"
"net/http"
)
func (s *BybitClientRequest) GetLeverageTokenInfo(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error) {
if err = handlers.ValidateParams(s.params); err != nil {
return nil, err
}
r := &request{
method: http.MethodGet,
endpoint: "/v5/spot-lever-token/info",
secType: secTypeSigned,
}
data := SendRequest(ctx, opts, r, s, err)
return GetServerResponse(err, data)
}
func (s *BybitClientRequest) GetLeverageTokenOrders(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error) {
if err = handlers.ValidateParams(s.params); err != nil {
return nil, err
}
r := &request{
method: http.MethodGet,
endpoint: "/v5/spot-lever-token/order-record",
secType: secTypeSigned,
}
data := SendRequest(ctx, opts, r, s, err)
return GetServerResponse(err, data)
}
func (s *BybitClientRequest) GetLeverageTokenMarket(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error) {
if err = handlers.ValidateParams(s.params); err != nil {
return nil, err
}
r := &request{
method: http.MethodGet,
endpoint: "/v5/spot-lever-token/reference",
secType: secTypeSigned,
}
data := SendRequest(ctx, opts, r, s, err)
return GetServerResponse(err, data)
}
func (s *BybitClientRequest) PurchaseLeverageToken(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error) {
if err = handlers.ValidateParams(s.params); err != nil {
return nil, err
}
r := &request{
method: http.MethodPost,
endpoint: "/v5/spot-lever-token/purchase",
secType: secTypeSigned,
}
data := SendRequest(ctx, opts, r, s, err)
return GetServerResponse(err, data)
}
func (s *BybitClientRequest) RedeemLeverageToken(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error) {
if err = handlers.ValidateParams(s.params); err != nil {
return nil, err
}
r := &request{
method: http.MethodPost,
endpoint: "/v5/spot-lever-token/redeem",
secType: secTypeSigned,
}
data := SendRequest(ctx, opts, r, s, err)
return GetServerResponse(err, data)
}