Skip to content

Commit

Permalink
set RateLimitOrder10s RateLimitOrder1m in CreateBatchOrders
Browse files Browse the repository at this point in the history
  • Loading branch information
xyq-c-cpp committed Jun 9, 2024
1 parent ed9503e commit 4cb233a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion v2/options/order_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -455,15 +455,21 @@ func (s *CancelBatchOrdersService) Do(ctx context.Context, opts ...RequestOption
}
r.setFormParam("clientOrderIds", strings.Join(strings.Fields(fmt.Sprint(cids)), ","))
}
data, _, err := s.c.callAPI(ctx, r, opts...)
data, header, err := s.c.callAPI(ctx, r, opts...)
if err != nil {
return nil, err
}
rlos := header.Get("X-Mbx-Order-Count-10s")
rlom := header.Get("X-Mbx-Order-Count-1m")
res = make([]*Order, 0)
err = json.Unmarshal(data, &res)
if err != nil {
return []*Order{}, err
}
for idx := range res {
res[idx].RateLimitOrder10s = rlos
res[idx].RateLimitOrder1m = rlom
}
return res, nil
}

Expand Down

0 comments on commit 4cb233a

Please sign in to comment.