-
-
Notifications
You must be signed in to change notification settings - Fork 272
/
account.go
39 lines (31 loc) · 1.11 KB
/
account.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
package kucoinapi
//go:generate -command GetRequest requestgen -method GET -responseType .APIResponse -responseDataField Data
//go:generate -command PostRequest requestgen -method POST -responseType .APIResponse -responseDataField Data
import (
"github.com/c9s/requestgen"
"github.com/c9s/bbgo/pkg/fixedpoint"
)
type AccountService struct {
client *RestClient
}
func (s *AccountService) NewListSubAccountsRequest() *ListSubAccountsRequest {
return &ListSubAccountsRequest{client: s.client}
}
type SubAccount struct {
UserID string `json:"userId"`
Name string `json:"subName"`
Type string `json:"type"`
Remark string `json:"remarks"`
}
//go:generate GetRequest -url "/api/v1/sub/user" -type ListSubAccountsRequest -responseDataType []SubAccount
type ListSubAccountsRequest struct {
client requestgen.AuthenticatedAPIClient
}
type Account struct {
ID string `json:"id"`
Currency string `json:"currency"`
Type AccountType `json:"type"`
Balance fixedpoint.Value `json:"balance"`
Available fixedpoint.Value `json:"available"`
Holds fixedpoint.Value `json:"holds"`
}