-
Notifications
You must be signed in to change notification settings - Fork 2
/
asset_detail_service.go
44 lines (37 loc) · 1.09 KB
/
asset_detail_service.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 binance
import (
"context"
"github.com/crypto-zero/go-binance/v2/common"
)
// GetAssetDetailService fetches all asset detail.
//
// See https://binance-docs.github.io/apidocs/spot/en/#asset-detail-user_data
type GetAssetDetailService struct {
c *Client
asset *string
}
// Asset sets the asset parameter.
func (s *GetAssetDetailService) Asset(asset string) *GetAssetDetailService {
s.asset = &asset
return s
}
// Do send the Request.
func (s *GetAssetDetailService) Do(ctx context.Context) (res map[string]AssetDetail, err error) {
r := common.NewGetRequestSigned("/sapi/v1/asset/assetDetail")
if s.asset != nil {
r.SetQuery("asset", *s.asset)
}
res = make(map[string]AssetDetail)
if err = s.c.CallAPI(ctx, r, &res); err != nil {
return
}
return res, nil
}
// AssetDetail represents the detail of an asset
type AssetDetail struct {
MinWithdrawAmount float64 `json:"minWithdrawAmount"`
DepositStatus bool `json:"depositStatus"`
WithdrawFee float64 `json:"withdrawFee"`
WithdrawStatus bool `json:"withdrawStatus"`
DepositTip string `json:"depositTip"`
}