mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-25 08:15:15 +00:00
kucoin: split request files
This commit is contained in:
parent
71be12bfc3
commit
feb20571e9
|
@ -17,14 +17,6 @@ func (s *AccountService) NewListSubAccountsRequest() *ListSubAccountsRequest {
|
|||
return &ListSubAccountsRequest{client: s.client}
|
||||
}
|
||||
|
||||
func (s *AccountService) NewListAccountsRequest() *ListAccountsRequest {
|
||||
return &ListAccountsRequest{client: s.client}
|
||||
}
|
||||
|
||||
func (s *AccountService) NewGetAccountRequest(accountID string) *GetAccountRequest {
|
||||
return &GetAccountRequest{client: s.client, accountID: accountID}
|
||||
}
|
||||
|
||||
type SubAccount struct {
|
||||
UserID string `json:"userId"`
|
||||
Name string `json:"subName"`
|
||||
|
@ -45,14 +37,3 @@ type Account struct {
|
|||
Available fixedpoint.Value `json:"available"`
|
||||
Holds fixedpoint.Value `json:"holds"`
|
||||
}
|
||||
|
||||
//go:generate GetRequest -url "/api/v1/accounts" -type ListAccountsRequest -responseDataType []Account
|
||||
type ListAccountsRequest struct {
|
||||
client requestgen.AuthenticatedAPIClient
|
||||
}
|
||||
|
||||
//go:generate GetRequest -url "/api/v1/accounts/:accountID" -type GetAccountRequest -responseDataType .Account
|
||||
type GetAccountRequest struct {
|
||||
client requestgen.AuthenticatedAPIClient
|
||||
accountID string `param:"accountID,slug"`
|
||||
}
|
||||
|
|
16
pkg/exchange/kucoin/kucoinapi/get_account_request.go
Normal file
16
pkg/exchange/kucoin/kucoinapi/get_account_request.go
Normal file
|
@ -0,0 +1,16 @@
|
|||
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"
|
||||
|
||||
//go:generate GetRequest -url "/api/v1/accounts/:accountID" -type GetAccountRequest -responseDataType .Account
|
||||
type GetAccountRequest struct {
|
||||
client requestgen.AuthenticatedAPIClient
|
||||
accountID string `param:"accountID,slug"`
|
||||
}
|
||||
|
||||
func (s *AccountService) NewGetAccountRequest(accountID string) *GetAccountRequest {
|
||||
return &GetAccountRequest{client: s.client, accountID: accountID}
|
||||
}
|
15
pkg/exchange/kucoin/kucoinapi/list_accounts_request.go
Normal file
15
pkg/exchange/kucoin/kucoinapi/list_accounts_request.go
Normal file
|
@ -0,0 +1,15 @@
|
|||
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"
|
||||
|
||||
//go:generate GetRequest -url "/api/v1/accounts" -type ListAccountsRequest -responseDataType []Account
|
||||
type ListAccountsRequest struct {
|
||||
client requestgen.AuthenticatedAPIClient
|
||||
}
|
||||
|
||||
func (s *AccountService) NewListAccountsRequest() *ListAccountsRequest {
|
||||
return &ListAccountsRequest{client: s.client}
|
||||
}
|
Loading…
Reference in New Issue
Block a user