Skip to content

Commit 3ad1808

Browse files
author
shazbert
committed
glorious: catch
1 parent ad5f2fe commit 3ad1808

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

exchanges/bybit/convert.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"net/url"
99
"slices"
1010
"strconv"
11+
"strings"
1112

1213
"github.com/thrasher-corp/gocryptotrader/currency"
1314
"github.com/thrasher-corp/gocryptotrader/encoding/json"
@@ -235,12 +236,17 @@ type ConvertHistoryResponse struct {
235236
// GetConvertHistory retrieves the conversion history for the specified account types.
236237
// All params are optional
237238
func (e *Exchange) GetConvertHistory(ctx context.Context, accountTypes []WalletAccountType, index, limit uint64) ([]ConvertHistoryResponse, error) {
238-
params := url.Values{}
239+
atOut := make([]string, 0, len(accountTypes))
239240
for _, accountType := range accountTypes {
240241
if !slices.Contains(supportedAccountTypes, accountType) {
241242
return nil, fmt.Errorf("%w: %q", errUnsupportedAccountType, accountType)
242243
}
243-
params.Add("accountType", string(accountType))
244+
atOut = append(atOut, string(accountType))
245+
}
246+
247+
params := url.Values{}
248+
if len(atOut) > 0 {
249+
params.Add("accountType", strings.Join(atOut, ","))
244250
}
245251

246252
if index != 0 {

0 commit comments

Comments
 (0)