-
-
Notifications
You must be signed in to change notification settings - Fork 275
/
get_account_transfers_request.go
44 lines (35 loc) · 1.46 KB
/
get_account_transfers_request.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
package bitgetapi
//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"
"github.com/c9s/bbgo/pkg/types"
)
type AccountType string
const (
AccountExchange AccountType = "EXCHANGE"
AccountContract AccountType = "CONTRACT"
)
type Transfer struct {
CTime types.MillisecondTimestamp `json:"cTime"`
CoinId string `json:"coinId"`
CoinName string `json:"coinName"`
GroupType string `json:"groupType"`
BizType string `json:"bizType"`
Quantity fixedpoint.Value `json:"quantity"`
Balance fixedpoint.Value `json:"balance"`
Fees fixedpoint.Value `json:"fees"`
BillId string `json:"billId"`
}
//go:generate GetRequest -url "/api/spot/v1/account/transferRecords" -type GetAccountTransfersRequest -responseDataType []Transfer
type GetAccountTransfersRequest struct {
client requestgen.AuthenticatedAPIClient
coinId int `param:"coinId"`
fromType AccountType `param:"fromType"`
after string `param:"after"`
before string `param:"before"`
}
func (c *RestClient) NewGetAccountTransfersRequest() *GetAccountTransfersRequest {
return &GetAccountTransfersRequest{client: c}
}