Skip to content

Commit

Permalink
ListWithdrawsService add withdrawOrderId support (#334)
Browse files Browse the repository at this point in the history
* ListWithdrawsService add withdrawOrderId support

* use string intead of float64 for number
  • Loading branch information
mm2175 committed Jan 8, 2022
1 parent 85cffbb commit b9a21fe
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions v2/withdraw_service.go
Expand Up @@ -117,13 +117,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 @@ -132,6 +133,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 @@ -174,6 +181,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 @@ -208,10 +218,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"`
}

0 comments on commit b9a21fe

Please sign in to comment.