rename the variables and read the stables param from the config

This commit is contained in:
Alfred Kamanda 2025-05-21 15:42:06 +03:00
parent a354371a94
commit 343d30a2f2
Signed by: Alfred-mk
GPG Key ID: 7EA3D01708908703

View File

@ -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
}