-
-
Notifications
You must be signed in to change notification settings - Fork 68
/
client_service.go
141 lines (117 loc) · 3.11 KB
/
client_service.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
package bybit
// SpotServiceI :
type SpotServiceI interface {
V1() SpotV1ServiceI
V3() *SpotV3Service
}
// SpotService :
type SpotService struct {
client *Client
}
// V1 :
func (s *SpotService) V1() SpotV1ServiceI {
return &SpotV1Service{s.client}
}
// V3 :
func (s *SpotService) V3() *SpotV3Service {
return &SpotV3Service{s.client}
}
// Spot :
func (c *Client) Spot() SpotServiceI {
return &SpotService{c}
}
// NewTimeService :
func (c *Client) NewTimeService() TimeServiceI {
return &TimeService{c}
}
// FutureServiceI :
type FutureServiceI interface {
InversePerpetual() FutureInversePerpetualServiceI
USDTPerpetual() FutureUSDTPerpetualServiceI
InverseFuture() FutureInverseFutureServiceI
}
// FutureService :
type FutureService struct {
client *Client
}
// InversePerpetual :
func (s *FutureService) InversePerpetual() FutureInversePerpetualServiceI {
return &FutureInversePerpetualService{
client: s.client,
FutureCommonService: &FutureCommonService{s.client},
}
}
// USDTPerpetual :
func (s *FutureService) USDTPerpetual() FutureUSDTPerpetualServiceI {
return &FutureUSDTPerpetualService{
client: s.client,
FutureCommonService: &FutureCommonService{s.client},
}
}
// InverseFuture :
func (s *FutureService) InverseFuture() FutureInverseFutureServiceI {
return &FutureInverseFutureService{
client: s.client,
FutureCommonService: &FutureCommonService{s.client},
}
}
// Future :
func (c *Client) Future() FutureServiceI {
return &FutureService{c}
}
// DerivativeServiceI :
type DerivativeServiceI interface {
UnifiedMargin() DerivativeUnifiedMarginServiceI
Contract() DerivativeContractServiceI
}
// DerivativeService :
type DerivativeService struct {
client *Client
}
// UnifiedMargin :
func (s *DerivativeService) UnifiedMargin() DerivativeUnifiedMarginServiceI {
return &DerivativeUnifiedMarginService{
client: s.client,
DerivativeCommonService: &DerivativeCommonService{s.client},
}
}
// Contract :
func (s *DerivativeService) Contract() DerivativeContractServiceI {
return &DerivativeContractService{
client: s.client,
DerivativeCommonService: &DerivativeCommonService{s.client},
}
}
// Derivative :
func (c *Client) Derivative() DerivativeServiceI {
return &DerivativeService{c.withCheckResponseBody(checkV3ResponseBody)}
}
// AccountAsset :
func (c *Client) AccountAsset() *AccountAssetService {
return &AccountAssetService{c}
}
// CopyTrading :
func (c *Client) CopyTrading() *CopyTradingService {
return &CopyTradingService{c}
}
// USDCContractServiceI :
type USDCContractServiceI interface {
Option() *USDCContractOptionService
Perpetual() *USDCContractPerpetualService
}
// USDCContractService :
type USDCContractService struct {
client *Client
}
// Option :
func (s *USDCContractService) Option() *USDCContractOptionService {
return &USDCContractOptionService{s.client}
}
// Perpetual :
func (s *USDCContractService) Perpetual() *USDCContractPerpetualService {
return &USDCContractPerpetualService{s.client}
}
// USDCContract :
func (c *Client) USDCContract() USDCContractServiceI {
return &USDCContractService{c}
}