diff --git a/v2/exchange_info_service.go b/v2/exchange_info_service.go index b05cd260..ea0167c7 100644 --- a/v2/exchange_info_service.go +++ b/v2/exchange_info_service.go @@ -3,6 +3,7 @@ package binance import ( "context" "encoding/json" + "fmt" "strings" ) @@ -37,7 +38,7 @@ func (s *ExchangeInfoService) Do(ctx context.Context, opts ...RequestOption) (re m["symbol"] = s.symbol } if len(s.symbols) != 0 { - r.setParam("symbols", strings.Join(s.symbols, ",")) + r.setParam("symbols", fmt.Sprintf("[%s]", strings.Join(s.symbols, ","))) } r.setParams(m) data, err := s.c.callAPI(ctx, r, opts...) diff --git a/v2/exchange_info_service_test.go b/v2/exchange_info_service_test.go index 91023aa9..3c10cd32 100644 --- a/v2/exchange_info_service_test.go +++ b/v2/exchange_info_service_test.go @@ -1,6 +1,7 @@ package binance import ( + "fmt" "strings" "testing" @@ -65,7 +66,7 @@ func (s *exchangeInfoServiceTestSuite) TestExchangeInfo() { e := newRequest().setParams(map[string]interface{}{ "symbol": symbol, }) - e.setParam("symbols", strings.Join(symbols, ",")) + e.setParam("symbols", fmt.Sprintf("[%s]", strings.Join(symbols, ","))) s.assertRequestEqual(e, r) }) res, err := s.client.NewExchangeInfoService().Symbol(symbol).Symbols(symbols...).Do(newContext())