forked from c9s/bbgo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_account_assets_request.go
39 lines (30 loc) · 1.25 KB
/
get_account_assets_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
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 AccountAsset struct {
Coin string `json:"coin"`
Available fixedpoint.Value `json:"available"`
Frozen fixedpoint.Value `json:"frozen"`
Locked fixedpoint.Value `json:"locked"`
LimitAvailable fixedpoint.Value `json:"limitAvailable"`
UpdatedTime types.MillisecondTimestamp `json:"uTime"`
}
type AssetType string
const (
AssetTypeHoldOnly AssetType = "hold_only"
AssetTypeHAll AssetType = "all"
)
//go:generate GetRequest -url "/api/v2/spot/account/assets" -type GetAccountAssetsRequest -responseDataType []AccountAsset
type GetAccountAssetsRequest struct {
client requestgen.AuthenticatedAPIClient
coin *string `param:"symbol,query"`
assetType AssetType `param:"assetType,query"`
}
func (c *Client) NewGetAccountAssetsRequest() *GetAccountAssetsRequest {
return &GetAccountAssetsRequest{client: c.Client}
}