Skip to content

Commit

Permalink
fix: request construction for multiple symbols not working for coinbase
Browse files Browse the repository at this point in the history
  • Loading branch information
achannarasappa committed Nov 10, 2024
1 parent 713ec02 commit 486fde0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions internal/quote/coinbase/quote.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package coinbase

import (
"net/url"
"strconv"
"strings"

Expand Down Expand Up @@ -84,11 +85,9 @@ func transformResponseQuotes(responseQuotes []ResponseQuote) []c.AssetQuote {
// GetAssetQuotes issues a HTTP request to retrieve quotes from the Coinbase API
func GetAssetQuotes(client resty.Client, symbols []string) []c.AssetQuote {

symbolsString := strings.Join(symbols, "&product_ids=")

res, _ := client.R().
SetResult(Response{}).
SetQueryParam("product_ids", symbolsString).
SetQueryParamsFromValues(url.Values{"product_ids": symbols}).
Get("https://api.coinbase.com/api/v3/brokerage/market/products")

return transformResponseQuotes(res.Result().(*Response).Products) //nolint:forcetypeassert
Expand Down

0 comments on commit 486fde0

Please sign in to comment.