From b305fa9148738d7d1f4d861f927386ca52c998ff Mon Sep 17 00:00:00 2001 From: BZ-CO <30245815+BZ-CO@users.noreply.github.com> Date: Mon, 18 Nov 2024 23:20:01 +0200 Subject: [PATCH] Fix MEXC ticker overflow --- .../API/Exchanges/MEXC/ExchangeMEXCAPI.cs | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/ExchangeSharp/API/Exchanges/MEXC/ExchangeMEXCAPI.cs b/src/ExchangeSharp/API/Exchanges/MEXC/ExchangeMEXCAPI.cs index ad1c08a1..0c5c341b 100644 --- a/src/ExchangeSharp/API/Exchanges/MEXC/ExchangeMEXCAPI.cs +++ b/src/ExchangeSharp/API/Exchanges/MEXC/ExchangeMEXCAPI.cs @@ -74,16 +74,22 @@ protected override async Task>> foreach (var t in token) { var symbol = (t["symbol"] ?? throw new ArgumentNullException()).ToStringInvariant(); - tickers.Add(new KeyValuePair(symbol, - await this.ParseTickerAsync( - t, - symbol, - "askPrice", - "bidPrice", - "lastPrice", - "volume", - timestampType: TimestampType.UnixMilliseconds, - timestampKey: "closeTime"))); + try + { + tickers.Add(new KeyValuePair(symbol, + await this.ParseTickerAsync( + t, + symbol, + "askPrice", + "bidPrice", + "lastPrice", + "volume", + timestampType: TimestampType.UnixMilliseconds, + timestampKey: "closeTime"))); + } + catch (OverflowException) + { + } } return tickers;