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

myTrades set filed orderId #308

Merged
merged 1 commit into from
Sep 27, 2021
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
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