From 343d30a2f27cabf2962f41e818396d351f775601 Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Wed, 21 May 2025 15:42:06 +0300 Subject: [PATCH] rename the variables and read the stables param from the config --- remote/http/service.go | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/remote/http/service.go b/remote/http/service.go index 612a93b..00c055a 100644 --- a/remote/http/service.go +++ b/remote/http/service.go @@ -403,20 +403,23 @@ func (as HTTPAccountService) getPoolSwappableVouchers(ctx context.Context, poolA PoolSwappableVouchers []dataserviceapi.TokenHoldings `json:"filtered"` } - ep, err := url.JoinPath(config.PoolSwappableVouchersURL, poolAddress, "to") - if err != nil { - return nil, err - } - u, err := url.Parse(ep) + basePath, err := url.JoinPath(config.PoolSwappableVouchersURL, poolAddress, "to") if err != nil { return nil, err } - query := u.Query() - query.Set("stable", "true") - u.RawQuery = query.Encode() + parsedURL, err := url.Parse(basePath) + if err != nil { + return nil, err + } - req, err := http.NewRequest("GET", u.String(), nil) + query := parsedURL.Query() + if config.IncludeStablesParam != "" { + query.Set("stables", config.IncludeStablesParam) + } + parsedURL.RawQuery = query.Encode() + + req, err := http.NewRequest("GET", parsedURL.String(), nil) if err != nil { return nil, err }