Skip to content

Commit

Permalink
myTrades set filed orderId
Browse files Browse the repository at this point in the history
  • Loading branch information
WuHuaJi0 committed Sep 17, 2021
1 parent aea3128 commit a8d02b9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions v2/trade_service.go
Expand Up @@ -13,6 +13,7 @@ type ListTradesService struct {
endTime *int64
limit *int
fromID *int64
orderId *int64
}

// Symbol set symbol
Expand Down Expand Up @@ -45,6 +46,12 @@ func (s *ListTradesService) FromID(fromID int64) *ListTradesService {
return s
}

// OrderId set OrderId
func (s *ListTradesService) OrderId(OrderId int64) *ListTradesService {
s.orderId = &OrderId
return s
}

// Do send request
func (s *ListTradesService) Do(ctx context.Context, opts ...RequestOption) (res []*TradeV3, err error) {
r := &request{
Expand All @@ -65,6 +72,9 @@ func (s *ListTradesService) Do(ctx context.Context, opts ...RequestOption) (res
if s.fromID != nil {
r.setParam("fromId", *s.fromID)
}
if s.orderId != nil {
r.setParam("orderId", *s.orderId)
}
data, err := s.c.callAPI(ctx, r, opts...)
if err != nil {
return []*TradeV3{}, err
Expand Down

1 comment on commit a8d02b9

@biter777
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, make a new tag or release of package

Please sign in to comment.