ExchangeSharp icon indicating copy to clipboard operation
ExchangeSharp copied to clipboard

Kraken Get ticker failing

Open Kukks opened this issue 3 years ago • 2 comments
trafficstars

The kraken provider is failing when fetching the tickers.

The error from the API is 3 errors of EQuery:Unknown asset pair, which I've narrowed down to the AED pairs. There is still a result with the other tickers so it should not fail.

In our forked variant in BTCPay, we are doing the following:

var result = JsonConvert.DeserializeObject<T>(stringResult);
            if (result is JToken json)
            {
                if (!(json is JArray) && json["result"] is JObject {Count: > 0} pairResult)
                {
                    return (T)(object)(pairResult);
                } 
                
                if (!(json is JArray) && json["error"] is JArray error && error.Count != 0)
                {
                    throw new APIException(string.Join("\n",
                        error.Select(token => token.ToStringInvariant()).Distinct()));
                }
                result = (T)(object)(json["result"] ?? json);
            }
            return result

Kukks avatar Aug 10 '22 06:08 Kukks

Thanks for reporting this. Would you be able to send a PR with these changes?

vslee avatar Aug 10 '22 08:08 vslee

@Kukks I just tested them out, but wasn't able to reproduce your issue. Both GetTickersAsync() and GetTickersWebSocketAsync() seem to work for me. Could you post a repro? (or sending the PR is still fine too)

vslee avatar Aug 20 '22 06:08 vslee

Closing due to inactivity.

vslee avatar Apr 22 '23 18:04 vslee