Skip to content

Commit 2842c6c

Browse files
authored
Merge pull request #794 from boyi/fix/origClientOrderIdList-string-format
FIX: origClientOrderIdList format in BatchCancelOrders API
2 parents 36a1f70 + b9d6edd commit 2842c6c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

v2/futures/order_service.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,9 @@ func (s *CancelMultiplesOrdersService) Do(ctx context.Context, opts ...RequestOp
791791
r.setFormParam("orderIdList", orderIDListString)
792792
}
793793
if s.origClientOrderIDList != nil {
794-
r.setFormParam("origClientOrderIdList", s.origClientOrderIDList)
794+
// convert a slice of strings to a string e.g. ["my_id_1","my_id_2"], encode the double quotes. No space after comma.
795+
origClientOrderIDListString := "[\"" + strings.Join(s.origClientOrderIDList, "\",\"") + "\"]"
796+
r.setFormParam("origClientOrderIdList", origClientOrderIDListString)
795797
}
796798
data, _, err := s.c.callAPI(ctx, r, opts...)
797799
if err != nil {

0 commit comments

Comments
 (0)