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 all commits
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
27 changes: 19 additions & 8 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 @@ -207,10 +217,11 @@ type Withdraw struct {
ApplyTime string `json:"applyTime"`
Coin string `json:"coin"`
ID string `json:"id"`
WithdrawOrderID string `json:"withdrawOrderID"`
WithdrawOrderID string `json:"withdrawOrderId"`
Network string `json:"network"`
TransferType int `json:"transferType"`
Status int `json:"status"`
TransactionFee string `json:"transactionFee"`
Info string `json:"info"`
TxID string `json:"txId"`
}