Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ListWithdrawsService add withdrawOrderId support #334

Merged
merged 2 commits into from Jan 8, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
47 changes: 29 additions & 18 deletions v2/withdraw_service.go
Expand Up @@ -116,13 +116,14 @@ type CreateWithdrawResponse struct {
//
// See https://binance-docs.github.io/apidocs/spot/en/#withdraw-history-supporting-network-user_data
type ListWithdrawsService struct {
c *Client
coin *string
status *int
startTime *int64
endTime *int64
offset *int
limit *int
c *Client
coin *string
withdrawOrderId *string
status *int
startTime *int64
endTime *int64
offset *int
limit *int
}

// Coin sets the coin parameter.
Expand All @@ -131,6 +132,12 @@ func (s *ListWithdrawsService) Coin(coin string) *ListWithdrawsService {
return s
}

// WithdrawOrderId sets the withdrawOrderId parameter.
func (s *ListWithdrawsService) WithdrawOrderId(withdrawOrderId string) *ListWithdrawsService {
s.withdrawOrderId = &withdrawOrderId
return s
}

// Status sets the status parameter.
func (s *ListWithdrawsService) Status(status int) *ListWithdrawsService {
s.status = &status
Expand Down Expand Up @@ -173,6 +180,9 @@ func (s *ListWithdrawsService) Do(ctx context.Context) (res []*Withdraw, err err
if s.coin != nil {
r.setParam("coin", *s.coin)
}
if s.withdrawOrderId != nil {
r.setParam("withdrawOrderId", *s.withdrawOrderId)
}
if s.status != nil {
r.setParam("status", *s.status)
}
Expand Down Expand Up @@ -202,15 +212,16 @@ func (s *ListWithdrawsService) Do(ctx context.Context) (res []*Withdraw, err err

// Withdraw represents a single withdraw entry.
type Withdraw struct {
Address string `json:"address"`
Amount string `json:"amount"`
ApplyTime string `json:"applyTime"`
Coin string `json:"coin"`
ID string `json:"id"`
WithdrawOrderID string `json:"withdrawOrderID"`
Network string `json:"network"`
TransferType int `json:"transferType"`
Status int `json:"status"`
TransactionFee string `json:"transactionFee"`
TxID string `json:"txId"`
Address string `json:"address"`
Amount float64 `json:"amount,string"`
mm2175 marked this conversation as resolved.
Show resolved Hide resolved
ApplyTime string `json:"applyTime"`
Coin string `json:"coin"`
ID string `json:"id"`
WithdrawOrderID string `json:"withdrawOrderId"`
Network string `json:"network"`
TransferType int `json:"transferType"`
Status int `json:"status"`
TransactionFee float64 `json:"transactionFee,string"`
Info string `json:"info"`
TxID string `json:"txId"`
}