Skip to content

Commit 4cb233a

Browse files
committed
set RateLimitOrder10s RateLimitOrder1m in CreateBatchOrders
1 parent ed9503e commit 4cb233a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

v2/options/order_service.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -455,15 +455,21 @@ func (s *CancelBatchOrdersService) Do(ctx context.Context, opts ...RequestOption
455455
}
456456
r.setFormParam("clientOrderIds", strings.Join(strings.Fields(fmt.Sprint(cids)), ","))
457457
}
458-
data, _, err := s.c.callAPI(ctx, r, opts...)
458+
data, header, err := s.c.callAPI(ctx, r, opts...)
459459
if err != nil {
460460
return nil, err
461461
}
462+
rlos := header.Get("X-Mbx-Order-Count-10s")
463+
rlom := header.Get("X-Mbx-Order-Count-1m")
462464
res = make([]*Order, 0)
463465
err = json.Unmarshal(data, &res)
464466
if err != nil {
465467
return []*Order{}, err
466468
}
469+
for idx := range res {
470+
res[idx].RateLimitOrder10s = rlos
471+
res[idx].RateLimitOrder1m = rlom
472+
}
467473
return res, nil
468474
}
469475

0 commit comments

Comments
 (0)