From 4cb233ac724d1fc1b6342c67e9d118bc76518325 Mon Sep 17 00:00:00 2001 From: xieyongqi <657023321@qq.com> Date: Sun, 9 Jun 2024 12:45:07 +0800 Subject: [PATCH] set RateLimitOrder10s RateLimitOrder1m in CreateBatchOrders --- v2/options/order_service.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/v2/options/order_service.go b/v2/options/order_service.go index 263eb1e4..eab0009f 100644 --- a/v2/options/order_service.go +++ b/v2/options/order_service.go @@ -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 }