-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrestPrivate.go
87 lines (64 loc) · 2.95 KB
/
restPrivate.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
package bitget
import (
v1 "github.com/yasseldg/bitget/pkg/client/v1"
v2 "github.com/yasseldg/bitget/pkg/client/v2"
)
type InterRest interface {
InterRestPublic
GetApiKeyList(subAccountUid string) (*v2.GetApiKeyList, error)
GetAccountInfo() (*v2.GetAccountInfo, error)
GetAccountList(productType string) (*v2.GetAccountList, error)
GetAllAccountBalance() (*v2.GetAllAccountBalance, error)
ChangeMarginMode(productType, symbol, marginCoin, marginMode string) (*v2.ChangeMarginMode, error)
ChangePositionMode(productType, posMode string) (*v2.ChangePositionMode, error)
GetPendingOrders(productType string) (*v2.GetPendingOrders, error)
PlaceOrder(productType, symbol, side, size, marginMode, marginCoin, orderType string) (*v2.PlaceOrder, error)
ModifyOrder(productType, symbol, newClientOid string) (*v2.ModifyOrder, error)
CancelOrder(productType, symbol string) (*v2.CancelOrder, error)
ClosePositions(productType string) (*v2.ClosePositions, error)
AgentCustomerList() (*v1.AgentCustomerList, error)
AgentCustomerTradeVolumeList() (*v1.AgentCustomerTradeVolumeList, error)
}
// agent
func (r *Rest) AgentCustomerList() (*v1.AgentCustomerList, error) {
return v1.NewAgentCustomerList(r.c)
}
func (r *Rest) AgentCustomerTradeVolumeList() (*v1.AgentCustomerTradeVolumeList, error) {
return v1.NewAgentCustomerTradeVolumeList(r.c)
}
// user
func (r *Rest) GetApiKeyList(subAccountUid string) (*v2.GetApiKeyList, error) {
return v2.NewGetApiKeyList(r.c, subAccountUid)
}
// account
func (r *Rest) GetAccountInfo() (*v2.GetAccountInfo, error) {
return v2.NewGetAccountInfo(r.c)
}
func (r *Rest) GetAccountList(productType string) (*v2.GetAccountList, error) {
return v2.NewGetAccountList(r.c, productType)
}
func (r *Rest) GetAllAccountBalance() (*v2.GetAllAccountBalance, error) {
return v2.NewGetAllAccountBalance(r.c)
}
func (r *Rest) ChangeMarginMode(productType, symbol, marginCoin, marginMode string) (*v2.ChangeMarginMode, error) {
return v2.NewChangeMarginMode(r.c, productType, symbol, marginCoin, marginMode)
}
func (r *Rest) ChangePositionMode(productType, posMode string) (*v2.ChangePositionMode, error) {
return v2.NewChangePositionMode(r.c, productType, posMode)
}
// order
func (r *Rest) GetPendingOrders(productType string) (*v2.GetPendingOrders, error) {
return v2.NewGetPendingOrders(r.c, productType)
}
func (r *Rest) PlaceOrder(productType, symbol, side, size, marginMode, marginCoin, orderType string) (*v2.PlaceOrder, error) {
return v2.NewPlaceOrder(r.c, productType, symbol, side, size, marginMode, marginCoin, orderType)
}
func (r *Rest) ModifyOrder(productType, symbol, newClientOid string) (*v2.ModifyOrder, error) {
return v2.NewModifyOrder(r.c, productType, symbol, newClientOid)
}
func (r *Rest) CancelOrder(productType, symbol string) (*v2.CancelOrder, error) {
return v2.NewCancelOrder(r.c, productType, symbol)
}
func (r *Rest) ClosePositions(productType string) (*v2.ClosePositions, error) {
return v2.NewClosePositions(r.c, productType)
}