@@ -6,20 +6,20 @@ import (
6
6
"net/http"
7
7
)
8
8
9
- // GetPositionRiskService get account balance
10
- type GetPositionRiskV2Service struct {
9
+ // GetPositionRiskV3Service get account balance
10
+ type GetPositionRiskService struct {
11
11
c * Client
12
12
symbol string
13
13
}
14
14
15
15
// Symbol set symbol
16
- func (s * GetPositionRiskV2Service ) Symbol (symbol string ) * GetPositionRiskV2Service {
16
+ func (s * GetPositionRiskService ) Symbol (symbol string ) * GetPositionRiskService {
17
17
s .symbol = symbol
18
18
return s
19
19
}
20
20
21
21
// Do send request
22
- func (s * GetPositionRiskV2Service ) Do (ctx context.Context , opts ... RequestOption ) (res []* PositionRiskV2 , err error ) {
22
+ func (s * GetPositionRiskService ) Do (ctx context.Context , opts ... RequestOption ) (res []* PositionRisk , err error ) {
23
23
r := & request {
24
24
method : http .MethodGet ,
25
25
endpoint : "/fapi/v2/positionRisk" ,
@@ -30,18 +30,18 @@ func (s *GetPositionRiskV2Service) Do(ctx context.Context, opts ...RequestOption
30
30
}
31
31
data , _ , err := s .c .callAPI (ctx , r , opts ... )
32
32
if err != nil {
33
- return []* PositionRiskV2 {}, err
33
+ return []* PositionRisk {}, err
34
34
}
35
- res = make ([]* PositionRiskV2 , 0 )
35
+ res = make ([]* PositionRisk , 0 )
36
36
err = json .Unmarshal (data , & res )
37
37
if err != nil {
38
- return []* PositionRiskV2 {}, err
38
+ return []* PositionRisk {}, err
39
39
}
40
40
return res , nil
41
41
}
42
42
43
43
// PositionRisk define position risk info
44
- type PositionRiskV2 struct {
44
+ type PositionRisk struct {
45
45
EntryPrice string `json:"entryPrice"`
46
46
BreakEvenPrice string `json:"breakEvenPrice"`
47
47
MarginType string `json:"marginType"`
@@ -59,25 +59,25 @@ type PositionRiskV2 struct {
59
59
IsolatedWallet string `json:"isolatedWallet"`
60
60
}
61
61
62
- type GetPositionRiskService struct {
62
+ type GetPositionRiskV3Service struct {
63
63
c * Client
64
64
symbol string
65
65
recvWindow * int64
66
66
}
67
67
68
68
// Symbol set symbol
69
- func (s * GetPositionRiskService ) Symbol (symbol string ) * GetPositionRiskService {
69
+ func (s * GetPositionRiskV3Service ) Symbol (symbol string ) * GetPositionRiskV3Service {
70
70
s .symbol = symbol
71
71
return s
72
72
}
73
73
74
- func (s * GetPositionRiskService ) RecvWindow (rw int64 ) * GetPositionRiskService {
74
+ func (s * GetPositionRiskV3Service ) RecvWindow (rw int64 ) * GetPositionRiskV3Service {
75
75
s .recvWindow = & rw
76
76
return s
77
77
}
78
78
79
79
// Do send request
80
- func (s * GetPositionRiskService ) Do (ctx context.Context , opts ... RequestOption ) (res []* PositionRisk , err error ) {
80
+ func (s * GetPositionRiskV3Service ) Do (ctx context.Context , opts ... RequestOption ) (res []* PositionRiskV3 , err error ) {
81
81
r := & request {
82
82
method : http .MethodGet ,
83
83
endpoint : "/fapi/v3/positionRisk" ,
@@ -92,18 +92,18 @@ func (s *GetPositionRiskService) Do(ctx context.Context, opts ...RequestOption)
92
92
93
93
data , _ , err := s .c .callAPI (ctx , r , opts ... )
94
94
if err != nil {
95
- return []* PositionRisk {}, err
95
+ return []* PositionRiskV3 {}, err
96
96
}
97
- res = make ([]* PositionRisk , 0 )
97
+ res = make ([]* PositionRiskV3 , 0 )
98
98
err = json .Unmarshal (data , & res )
99
99
if err != nil {
100
- return []* PositionRisk {}, err
100
+ return []* PositionRiskV3 {}, err
101
101
}
102
102
return res , nil
103
103
}
104
104
105
- // PositionRisk define position risk info
106
- type PositionRisk struct {
105
+ // PositionRiskV3 define position risk info
106
+ type PositionRiskV3 struct {
107
107
Symbol string `json:"symbol"`
108
108
PositionSide string `json:"positionSide"`
109
109
PositionAmt string `json:"positionAmt"`
0 commit comments