From 7d1eedcf9cffb3c53851a9d189d1e05c2431e121 Mon Sep 17 00:00:00 2001 From: SEONGAHN_LEE Date: Thu, 26 May 2022 16:25:30 +0900 Subject: [PATCH] applied build props file using --- Directory.Build.props | 15 +++++ ccxt.net.sln | 1 + samples/binance/Program.cs | 2 +- samples/binance/binance.csproj | 1 - samples/bitmex/bitmex.csproj | 1 - samples/bittrex/Program.cs | 2 +- samples/bittrex/bittrex.csproj | 1 - samples/kraken/kraken.csproj | 1 - .../PublishProfiles/FolderProfile.pubxml | 2 +- src/ccxt.net.csproj | 14 +---- src/exchanges/chn/bitforex/bitforex.cs | 6 +- .../chn/bitforex/private/privateApi.cs | 10 +-- .../chn/bitforex/public/publicApi.cs | 24 +++---- src/exchanges/chn/bitforex/trade/tradeApi.cs | 30 ++++----- src/exchanges/chn/gateio/gateio.cs | 4 +- .../chn/gateio/private/privateApi.cs | 26 ++++---- src/exchanges/chn/gateio/public/publicApi.cs | 18 +++--- src/exchanges/chn/gateio/trade/tradeApi.cs | 32 +++++----- src/exchanges/chn/huobi/huobi.cs | 8 +-- src/exchanges/chn/huobi/private/privateApi.cs | 28 ++++----- src/exchanges/chn/huobi/public/publicApi.cs | 28 ++++----- src/exchanges/chn/huobi/trade/tradeApi.cs | 44 ++++++------- src/exchanges/chn/okex/okex.cs | 12 ++-- src/exchanges/chn/okex/private/privateApi.cs | 30 ++++----- src/exchanges/chn/okex/public/publicApi.cs | 24 +++---- src/exchanges/chn/okex/trade/tradeApi.cs | 38 ++++++------ src/exchanges/chn/zb/private/privateApi.cs | 22 +++---- src/exchanges/chn/zb/public/publicApi.cs | 24 +++---- src/exchanges/chn/zb/trade/tradeApi.cs | 22 +++---- src/exchanges/chn/zb/zb.cs | 8 +-- src/exchanges/gbr/bitfinex/bitfinex.cs | 4 +- .../gbr/bitfinex/private/privateApi.cs | 26 ++++---- .../gbr/bitfinex/public/publicApi.cs | 22 +++---- src/exchanges/gbr/bitfinex/trade/order.cs | 6 +- src/exchanges/gbr/bitfinex/trade/place.cs | 4 +- src/exchanges/gbr/bitfinex/trade/tradeApi.cs | 40 ++++++------ src/exchanges/gbr/bitstamp/bitstamp.cs | 8 +-- .../gbr/bitstamp/private/privateApi.cs | 22 +++---- .../gbr/bitstamp/public/publicApi.cs | 14 ++--- src/exchanges/gbr/bitstamp/trade/tradeApi.cs | 32 +++++----- src/exchanges/gbr/cexio/cexio.cs | 8 +-- src/exchanges/gbr/cexio/private/privateApi.cs | 12 ++-- src/exchanges/gbr/cexio/public/publicApi.cs | 28 ++++----- src/exchanges/gbr/cexio/trade/trade.cs | 2 +- src/exchanges/gbr/cexio/trade/tradeApi.cs | 38 ++++++------ src/exchanges/hk/binance/binance.cs | 12 ++-- .../hk/binance/private/privateApi.cs | 36 +++++------ src/exchanges/hk/binance/public/publicApi.cs | 22 +++---- src/exchanges/hk/binance/trade/trade.cs | 2 +- src/exchanges/hk/binance/trade/tradeApi.cs | 32 +++++----- src/exchanges/jpn/anxpro/anxpro.cs | 6 +- .../jpn/anxpro/private/privateApi.cs | 24 +++---- src/exchanges/jpn/anxpro/public/publicApi.cs | 12 ++-- src/exchanges/jpn/anxpro/trade/tradeApi.cs | 30 ++++----- src/exchanges/jpn/bitflyer/bitflyer.cs | 6 +- .../jpn/bitflyer/private/privateApi.cs | 20 +++--- .../jpn/bitflyer/public/publicApi.cs | 18 +++--- src/exchanges/jpn/bitflyer/trade/tradeApi.cs | 36 +++++------ src/exchanges/jpn/coincheck/coincheck.cs | 10 +-- .../jpn/coincheck/private/privateApi.cs | 26 ++++---- .../jpn/coincheck/public/publicApi.cs | 12 ++-- src/exchanges/jpn/coincheck/trade/tradeApi.cs | 24 +++---- .../jpn/quoinex/private/privateApi.cs | 12 ++-- src/exchanges/jpn/quoinex/public/publicApi.cs | 18 +++--- src/exchanges/jpn/quoinex/quoinex.cs | 8 +-- src/exchanges/jpn/quoinex/trade/tradeApi.cs | 34 +++++----- src/exchanges/kor/bithumb/bithumb.cs | 6 +- .../kor/bithumb/private/privateApi.cs | 42 ++++++------- src/exchanges/kor/bithumb/public/publicApi.cs | 30 ++++----- src/exchanges/kor/bithumb/trade/tradeApi.cs | 54 ++++++++-------- src/exchanges/kor/coinone/coinone.cs | 8 +-- .../kor/coinone/private/privateApi.cs | 28 ++++----- src/exchanges/kor/coinone/public/publicApi.cs | 22 +++---- src/exchanges/kor/coinone/trade/tradeApi.cs | 24 +++---- src/exchanges/kor/gopax/gopax.cs | 8 +-- src/exchanges/kor/gopax/private/privateApi.cs | 8 +-- src/exchanges/kor/gopax/public/publicApi.cs | 22 +++---- src/exchanges/kor/gopax/trade/tradeApi.cs | 24 +++---- src/exchanges/kor/korbit/korbit.cs | 14 ++--- .../kor/korbit/private/privateApi.cs | 30 ++++----- src/exchanges/kor/korbit/public/publicApi.cs | 14 ++--- src/exchanges/kor/korbit/trade/tradeApi.cs | 36 +++++------ src/exchanges/kor/okcoinkr/okcoinkr.cs | 8 +-- src/exchanges/kor/okcoinkr/private/balance.cs | 2 +- .../kor/okcoinkr/private/privateApi.cs | 4 +- .../kor/okcoinkr/public/publicApi.cs | 18 +++--- src/exchanges/kor/okcoinkr/trade/order.cs | 2 +- src/exchanges/kor/okcoinkr/trade/place.cs | 2 +- src/exchanges/kor/okcoinkr/trade/tradeApi.cs | 34 +++++----- src/exchanges/kor/upbit/private/privateApi.cs | 42 ++++++------- src/exchanges/kor/upbit/public/publicApi.cs | 22 +++---- src/exchanges/kor/upbit/trade/tradeApi.cs | 24 +++---- src/exchanges/kor/upbit/upbit.cs | 10 +-- src/exchanges/sey/bitmex/bitmex.cs | 12 ++-- .../sey/bitmex/private/privateApi.cs | 24 +++---- src/exchanges/sey/bitmex/public/publicApi.cs | 28 ++++----- src/exchanges/sey/bitmex/trade/tradeApi.cs | 62 +++++++++---------- src/exchanges/usa/bittrex/bittrex.cs | 10 +-- .../usa/bittrex/private/privateApi.cs | 60 +++++++++--------- src/exchanges/usa/bittrex/public/publicApi.cs | 28 ++++----- src/exchanges/usa/bittrex/trade/order.cs | 2 +- src/exchanges/usa/bittrex/trade/tradeApi.cs | 26 ++++---- src/exchanges/usa/gdax/gdax.cs | 6 +- src/exchanges/usa/gdax/private/privateApi.cs | 12 ++-- src/exchanges/usa/gdax/public/publicApi.cs | 18 +++--- src/exchanges/usa/gdax/trade/tradeApi.cs | 40 ++++++------ src/exchanges/usa/gemini/gemini.cs | 6 +- .../usa/gemini/private/privateApi.cs | 22 +++---- src/exchanges/usa/gemini/public/publicApi.cs | 14 ++--- src/exchanges/usa/gemini/trade/order.cs | 6 +- src/exchanges/usa/gemini/trade/tradeApi.cs | 40 ++++++------ src/exchanges/usa/itbit/itbit.cs | 8 +-- src/exchanges/usa/itbit/private/privateApi.cs | 18 +++--- src/exchanges/usa/itbit/public/publicApi.cs | 12 ++-- src/exchanges/usa/itbit/trade/tradeApi.cs | 32 +++++----- src/exchanges/usa/kraken/kraken.cs | 6 +- .../usa/kraken/private/privateApi.cs | 38 ++++++------ src/exchanges/usa/kraken/public/publicApi.cs | 20 +++--- src/exchanges/usa/kraken/trade/tradeApi.cs | 40 ++++++------ src/exchanges/usa/poloniex/poloniex.cs | 4 +- .../usa/poloniex/private/privateApi.cs | 22 +++---- .../usa/poloniex/public/publicApi.cs | 22 +++---- src/exchanges/usa/poloniex/trade/tradeApi.cs | 20 +++--- src/shared/numerical.cs | 2 +- src/shared/standard/XApiClient.cs | 20 +++--- src/shared/standard/apiResult.cs | 2 +- src/shared/standard/exchangeInfo.cs | 10 +-- src/shared/standard/nameResult.cs | 4 +- src/shared/standard/private/privateApi.cs | 26 ++++---- src/shared/standard/public/publicApi.cs | 26 ++++---- src/shared/standard/trade/tradeApi.cs | 26 ++++---- src/shared/types/coinType.cs | 2 +- src/shared/types/currencyType.cs | 2 +- tests/ccxt.test/ccxt.test.csproj | 1 - tests/ccxt.test/private/bithumb.cs | 29 ++++----- tests/ccxt.test/private/bitmex.cs | 29 ++++----- tests/ccxt.test/private/coinone.cs | 33 +++++----- tests/ccxt.test/private/korbit.cs | 29 ++++----- tests/ccxt.test/private/poloniex.cs | 29 ++++----- tests/ccxt.test/public/bithumb.cs | 17 ++--- tests/ccxt.test/public/bitmex.cs | 15 ++--- tests/ccxt.test/public/coinone.cs | 15 ++--- tests/ccxt.test/public/korbit.cs | 15 ++--- tests/ccxt.test/public/poloniex.cs | 15 ++--- tests/ccxt.test/rootApi.cs | 4 +- tests/ccxt.test/trade/bithumb.cs | 25 ++++---- tests/ccxt.test/trade/bitmex.cs | 25 ++++---- tests/ccxt.test/trade/coinone.cs | 25 ++++---- tests/ccxt.test/trade/korbit.cs | 25 ++++---- tests/ccxt.test/trade/poloniex.cs | 25 ++++---- 150 files changed, 1415 insertions(+), 1401 deletions(-) create mode 100644 Directory.Build.props diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 0000000..abd136b --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,15 @@ + + + net6.0 + disable + + latest + + + + \ No newline at end of file diff --git a/ccxt.net.sln b/ccxt.net.sln index 87df432..bd490da 100644 --- a/ccxt.net.sln +++ b/ccxt.net.sln @@ -8,6 +8,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution appveyor.yml = appveyor.yml CHANGELOG.md = CHANGELOG.md CONTRIBUTING.md = CONTRIBUTING.md + Directory.Build.props = Directory.Build.props global.json = global.json LICENSE.txt = LICENSE.txt README.md = README.md diff --git a/samples/binance/Program.cs b/samples/binance/Program.cs index 0771028..9cbec5d 100644 --- a/samples/binance/Program.cs +++ b/samples/binance/Program.cs @@ -15,7 +15,7 @@ private static async Task Main(string[] args) if (__step_no == 0 || __step_no == 1) { var _tickers = await _public_api.FetchTickersAsync(); - if (_tickers.success == true) + if (_tickers.success) { var _btcusd_tickers = _tickers.result.Where(t => t.symbol.ToUpper().Contains("BTCUSD")); diff --git a/samples/binance/binance.csproj b/samples/binance/binance.csproj index 75e9c12..e80eaaa 100644 --- a/samples/binance/binance.csproj +++ b/samples/binance/binance.csproj @@ -2,7 +2,6 @@ Exe - net6.0 diff --git a/samples/bitmex/bitmex.csproj b/samples/bitmex/bitmex.csproj index a85d693..55b2c7f 100644 --- a/samples/bitmex/bitmex.csproj +++ b/samples/bitmex/bitmex.csproj @@ -2,7 +2,6 @@ Exe - net6.0 diff --git a/samples/bittrex/Program.cs b/samples/bittrex/Program.cs index 9d48157..4876042 100644 --- a/samples/bittrex/Program.cs +++ b/samples/bittrex/Program.cs @@ -15,7 +15,7 @@ private static async Task Main(string[] args) if (__step_no == 0 || __step_no == 1) { var _tickers = await _public_api.FetchTickersAsync(); - if (_tickers.success == true) + if (_tickers.success) { var _btcusd_tickers = _tickers.result.Where(t => t.symbol.ToUpper().Contains("BTC")); diff --git a/samples/bittrex/bittrex.csproj b/samples/bittrex/bittrex.csproj index 327f81d..4e01c34 100644 --- a/samples/bittrex/bittrex.csproj +++ b/samples/bittrex/bittrex.csproj @@ -2,7 +2,6 @@ Exe - net6.0 diff --git a/samples/kraken/kraken.csproj b/samples/kraken/kraken.csproj index a85d693..55b2c7f 100644 --- a/samples/kraken/kraken.csproj +++ b/samples/kraken/kraken.csproj @@ -2,7 +2,6 @@ Exe - net6.0 diff --git a/src/Properties/PublishProfiles/FolderProfile.pubxml b/src/Properties/PublishProfiles/FolderProfile.pubxml index b273e6a..2f2d033 100644 --- a/src/Properties/PublishProfiles/FolderProfile.pubxml +++ b/src/Properties/PublishProfiles/FolderProfile.pubxml @@ -8,7 +8,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Any CPU D:\deploy\ccxt.net FileSystem - net6.0 + false \ No newline at end of file diff --git a/src/ccxt.net.csproj b/src/ccxt.net.csproj index 37f3a56..d554d82 100644 --- a/src/ccxt.net.csproj +++ b/src/ccxt.net.csproj @@ -1,7 +1,6 @@  - net6.0 CryptoCurrency eXchange Trading Library for .NET CCXT ODINSOFT @@ -18,12 +17,11 @@ false false CCXT.NET - true + false 1.4.13 RestSharp update and upgrade to .net core 6. 1.4.13.1 1.4.13.1 - latest false LICENSE.txt README.md @@ -31,16 +29,6 @@ git - - bin\Debug\net472\CCXT.NET.xml - TRACE;DEBUG - - - - bin\Release\net472\CCXT.NET.xml - TRACE;RELEASE - - diff --git a/src/exchanges/chn/bitforex/bitforex.cs b/src/exchanges/chn/bitforex/bitforex.cs index 2457413..ac727fe 100644 --- a/src/exchanges/chn/bitforex/bitforex.cs +++ b/src/exchanges/chn/bitforex/bitforex.cs @@ -149,7 +149,7 @@ public override async ValueTask CreatePostRequestAsync(string endpo { var _request = await base.CreatePostRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _params = new Dictionary(); { @@ -224,7 +224,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) if (response != null) { - if (response.IsSuccessful == true) + if (response.IsSuccessful) { var _json_result = this.DeserializeObject(response.Content); @@ -243,7 +243,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) } } - if (_result.success == true && response.IsSuccessful == false) + if (_result.success && response.IsSuccessful == false) { _result.SetFailure( response.ErrorMessage ?? response.StatusDescription, diff --git a/src/exchanges/chn/bitforex/private/privateApi.cs b/src/exchanges/chn/bitforex/private/privateApi.cs index af52df1..8795e71 100644 --- a/src/exchanges/chn/bitforex/private/privateApi.cs +++ b/src/exchanges/chn/bitforex/private/privateApi.cs @@ -64,7 +64,7 @@ public override async ValueTask FetchBalanceAsync(string base_name, str var _result = new Balance(); var _currency_id = await publicApi.LoadCurrencyIdAsync(base_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -80,10 +80,10 @@ public override async ValueTask FetchBalanceAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _balance = privateClient.DeserializeObject(_json_value.Content); - if (_balance.success == true) + if (_balance.success) { _balance.result.currency = base_name; @@ -115,7 +115,7 @@ public override async ValueTask FetchBalancesAsync(Dictionary FetchBalancesAsync(Dictionary(_json_value.Content); { diff --git a/src/exchanges/chn/bitforex/public/publicApi.cs b/src/exchanges/chn/bitforex/public/publicApi.cs index 916dab8..2c04043 100644 --- a/src/exchanges/chn/bitforex/public/publicApi.cs +++ b/src/exchanges/chn/bitforex/public/publicApi.cs @@ -53,7 +53,7 @@ public override async ValueTask FetchMarketsAsync(Dictionary(_json_value.Content); @@ -70,7 +70,7 @@ public override async ValueTask FetchMarketsAsync(Dictionary FetchTickerAsync(string base_name, strin var _result = new Ticker(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -126,7 +126,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _ticker = publicClient.DeserializeObject(_json_value.Content); { @@ -159,7 +159,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam var _result = new OrderBooks(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -176,10 +176,10 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orderbooks = publicClient.DeserializeObject(_json_value.Content); - if (_orderbooks.success == true) + if (_orderbooks.success) { var _ob_asks = _orderbooks.result.asks.OrderBy(o => o.price).Take(limits).ToList(); var _ob_bids = _orderbooks.result.bids.OrderByDescending(o => o.price).Take(limits).ToList(); @@ -243,7 +243,7 @@ public override async ValueTask FetchOHLCVsAsync(string base_name, strin var _result = new OHLCVs(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -264,10 +264,10 @@ public override async ValueTask FetchOHLCVsAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _ohlcvs = publicClient.DeserializeObject(_json_value.Content); - if (_ohlcvs.success == true) + if (_ohlcvs.success) { _result.result.AddRange( _ohlcvs.result @@ -307,7 +307,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string var _result = new CompleteOrders(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -327,7 +327,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject(_json_value.Content); { diff --git a/src/exchanges/chn/bitforex/trade/tradeApi.cs b/src/exchanges/chn/bitforex/trade/tradeApi.cs index 324a609..b80a537 100644 --- a/src/exchanges/chn/bitforex/trade/tradeApi.cs +++ b/src/exchanges/chn/bitforex/trade/tradeApi.cs @@ -66,7 +66,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -83,7 +83,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -117,7 +117,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -134,7 +134,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orders = tradeClient.DeserializeObject(_json_value.Content); { @@ -173,7 +173,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s var _result = new MyTrades(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -193,7 +193,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { @@ -237,7 +237,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -258,7 +258,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -305,7 +305,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -321,10 +321,10 @@ public override async ValueTask CancelOrderAsync(string base_name, stri _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true && _json_data.data == true) + if (_json_data.success && _json_data.data) { var _order = new BPlaceOrderItem { @@ -371,7 +371,7 @@ public override async ValueTask CancelOrdersAsync(string base_name, st var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -406,13 +406,13 @@ public override async ValueTask CancelOrdersAsync(string base_name, st _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { if (order_ids.Length > 0) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { - if (_json_data.success == true) + if (_json_data.success) { foreach (var _j in _json_data.result) _result.result.Add(_j); @@ -426,7 +426,7 @@ public override async ValueTask CancelOrdersAsync(string base_name, st { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { - if (_json_data.success == true && _json_data.data == true) + if (_json_data.success && _json_data.data) _result.SetSuccess(); else _result.SetFailure(); diff --git a/src/exchanges/chn/gateio/gateio.cs b/src/exchanges/chn/gateio/gateio.cs index 3b3d75a..62e39de 100644 --- a/src/exchanges/chn/gateio/gateio.cs +++ b/src/exchanges/chn/gateio/gateio.cs @@ -160,7 +160,7 @@ public override async ValueTask CreatePostRequestAsync(string endpo { var _request = await base.CreatePostRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _post_params = _request.Parameters.ToDictionary(p => p.Name, p => p.Value); @@ -208,7 +208,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) } } - if (_result.success == true && response.IsSuccessful == false) + if (_result.success && response.IsSuccessful == false) { _result.SetFailure( response.ErrorMessage ?? response.StatusDescription, diff --git a/src/exchanges/chn/gateio/private/privateApi.cs b/src/exchanges/chn/gateio/private/privateApi.cs index 21d1182..23774d7 100644 --- a/src/exchanges/chn/gateio/private/privateApi.cs +++ b/src/exchanges/chn/gateio/private/privateApi.cs @@ -65,7 +65,7 @@ public override async ValueTask
CreateAddressAsync(string currency_name var _result = new Address(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -81,7 +81,7 @@ public override async ValueTask
CreateAddressAsync(string currency_name _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _address = privateClient.DeserializeObject(_json_value.Content); { @@ -112,7 +112,7 @@ public override async ValueTask
FetchAddressAsync(string currency_name, var _result = new Address(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -128,7 +128,7 @@ public override async ValueTask
FetchAddressAsync(string currency_name, _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _address = privateClient.DeserializeObject(_json_value.Content); { @@ -162,7 +162,7 @@ public override async ValueTask CoinWithdrawAsync(string currency_name var _result = new Transfer(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -180,12 +180,12 @@ public override async ValueTask CoinWithdrawAsync(string currency_name _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); { var _withdraw = new GTransferItem(); - if (_json_data["result"].Value() == true) + if (_json_data["result"].Value()) { _withdraw.timestamp = CUnixTime.NowMilli; _withdraw.transferId = _withdraw.timestamp.ToString(); // transferId 없음 @@ -231,7 +231,7 @@ public override async ValueTask FetchAllTransfersAsync(string timefra var _result = new Transfers(); var _markets = await publicApi.LoadMarketsAsync(); - if (_markets.success == true) + if (_markets.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -251,11 +251,11 @@ public override async ValueTask FetchAllTransfersAsync(string timefra _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); { - if (_json_data.success == true) + if (_json_data.success) { foreach (var _d in _json_data.deposits) { @@ -325,7 +325,7 @@ public override async ValueTask FetchBalancesAsync(Dictionary FetchBalancesAsync(Dictionary(_json_value.Content); { @@ -345,7 +345,7 @@ public override async ValueTask FetchBalancesAsync(Dictionary(); diff --git a/src/exchanges/chn/gateio/public/publicApi.cs b/src/exchanges/chn/gateio/public/publicApi.cs index 2351b9a..8ae1ff5 100644 --- a/src/exchanges/chn/gateio/public/publicApi.cs +++ b/src/exchanges/chn/gateio/public/publicApi.cs @@ -53,7 +53,7 @@ public override async ValueTask FetchMarketsAsync(Dictionary(_json_value.Content); foreach (var _m in _markets.result) @@ -125,7 +125,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin var _result = new Ticker(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -136,7 +136,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _ticker = publicClient.DeserializeObject(_json_value.Content); { @@ -177,7 +177,7 @@ public override async ValueTask FetchTickersAsync(Dictionary FetchTickersAsync(Dictionary>(_json_value.Content); { @@ -231,7 +231,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam var _result = new OrderBooks(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -242,7 +242,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orderbooks = publicClient.DeserializeObject(_json_value.Content); { @@ -290,7 +290,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string var _result = new CompleteOrders(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -316,7 +316,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject(_json_value.Content); { diff --git a/src/exchanges/chn/gateio/trade/tradeApi.cs b/src/exchanges/chn/gateio/trade/tradeApi.cs index daa5c3d..5e41842 100644 --- a/src/exchanges/chn/gateio/trade/tradeApi.cs +++ b/src/exchanges/chn/gateio/trade/tradeApi.cs @@ -66,7 +66,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -83,11 +83,11 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { - if (_order.success == true) + if (_order.success) { _order.result.amount = _order.result.price * _order.result.quantity; _order.result.orderType = OrderType.Limit; @@ -120,7 +120,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -136,11 +136,11 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orders = tradeClient.DeserializeObject(_json_value.Content); { - if (_orders.success == true) + if (_orders.success) { foreach (var _o in _orders.result) { @@ -177,7 +177,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s var _result = new MyTrades(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -196,11 +196,11 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { - if (_json_data.success == true) + if (_json_data.success) { var _trades = _json_data.result .Where(t => t.timestamp >= since) @@ -241,7 +241,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -261,7 +261,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { @@ -305,7 +305,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -322,11 +322,11 @@ public override async ValueTask CancelOrderAsync(string base_name, stri _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { - if (_json_data.success == true) + if (_json_data.success) { _json_data.price = price; _json_data.quantity = quantity; @@ -365,7 +365,7 @@ public override async ValueTask CancelOrdersAsync(string base_name, st var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -382,7 +382,7 @@ public override async ValueTask CancelOrdersAsync(string base_name, st _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); } diff --git a/src/exchanges/chn/huobi/huobi.cs b/src/exchanges/chn/huobi/huobi.cs index 9ec8b51..36c44fe 100644 --- a/src/exchanges/chn/huobi/huobi.cs +++ b/src/exchanges/chn/huobi/huobi.cs @@ -204,7 +204,7 @@ public override async ValueTask CreatePostRequestAsync(string endpo { var _request = await base.CreatePostRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _params = new Dictionary(); { @@ -237,7 +237,7 @@ public override async ValueTask CreateGetRequestAsync(string endpoi { var _request = await base.CreateGetRequestAsync($"{endpoint}", args); - if (IsAuthentication == true) + if (IsAuthentication) { var _params = new Dictionary(); { @@ -277,7 +277,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) if (response != null) { - if (response.IsSuccessful == true) + if (response.IsSuccessful) { var _json_result = this.DeserializeObject(response.Content); @@ -292,7 +292,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) } } - if (_result.success == true && response.IsSuccessful == false) + if (_result.success && response.IsSuccessful == false) { _result.SetFailure( response.ErrorMessage ?? response.StatusDescription, diff --git a/src/exchanges/chn/huobi/private/privateApi.cs b/src/exchanges/chn/huobi/private/privateApi.cs index 88335e7..a6aa55b 100644 --- a/src/exchanges/chn/huobi/private/privateApi.cs +++ b/src/exchanges/chn/huobi/private/privateApi.cs @@ -67,7 +67,7 @@ public override async ValueTask CoinWithdrawAsync(string currency_name var _result = new Transfer(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -87,7 +87,7 @@ public override async ValueTask CoinWithdrawAsync(string currency_name _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); { @@ -136,7 +136,7 @@ public override async ValueTask CancelCoinWithdrawAsync(string currenc var _result = new Transfer(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -147,10 +147,10 @@ public override async ValueTask CancelCoinWithdrawAsync(string currenc _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _transfer = new HTransferItem { @@ -200,7 +200,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n var _result = new Transfers(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { var _params = new Dictionary(); { @@ -224,7 +224,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n _result.rawJson += _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); { @@ -250,7 +250,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n _params.Add("type", "withdraw"); // TransactionType.Withdrawal - if (_result.success == true) + if (_result.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -259,7 +259,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n _result.rawJson += _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); { @@ -299,7 +299,7 @@ public override async ValueTask FetchBalancesAsync(Dictionary FetchBalancesAsync(Dictionary(_json_value.Content); { @@ -355,7 +355,7 @@ public async Task GetAccounts(Dictionary args = null) var _result = new HAccounts(); var _markets = await publicApi.LoadMarketsAsync(); - if (_markets.success == true) + if (_markets.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -366,11 +366,11 @@ public async Task GetAccounts(Dictionary args = null) // _result.rawJson = _json_value.Content; //#endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _accounts = privateClient.DeserializeObject(_json_value.Content); - if (_accounts.success == true) + if (_accounts.success) _result = _accounts; } diff --git a/src/exchanges/chn/huobi/public/publicApi.cs b/src/exchanges/chn/huobi/public/publicApi.cs index 5934dd7..edc60eb 100644 --- a/src/exchanges/chn/huobi/public/publicApi.cs +++ b/src/exchanges/chn/huobi/public/publicApi.cs @@ -53,7 +53,7 @@ public override async ValueTask FetchMarketsAsync(Dictionary(_json_value.Content); @@ -63,7 +63,7 @@ public override async ValueTask FetchMarketsAsync(Dictionary FetchTickerAsync(string base_name, strin var _result = new Ticker(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -122,7 +122,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _ticker = publicClient.DeserializeObject(_json_value.Content); { @@ -154,7 +154,7 @@ public override async ValueTask FetchTickersAsync(Dictionary FetchTickersAsync(Dictionary(_json_value.Content); { @@ -205,7 +205,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam var _result = new OrderBooks(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -222,10 +222,10 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orderbooks = publicClient.DeserializeObject(_json_value.Content); - if (_orderbooks.success == true) + if (_orderbooks.success) { var _ob_asks = _orderbooks.result.asks.OrderBy(o => o.price).Take(limits).ToList(); var _ob_bids = _orderbooks.result.bids.OrderByDescending(o => o.price).Take(limits).ToList(); @@ -289,7 +289,7 @@ public override async ValueTask FetchOHLCVsAsync(string base_name, strin var _result = new OHLCVs(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -310,10 +310,10 @@ public override async ValueTask FetchOHLCVsAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _ohlcvs = publicClient.DeserializeObject(_json_value.Content); - if (_ohlcvs.success == true) + if (_ohlcvs.success) { _result.result.AddRange( _ohlcvs.result @@ -353,7 +353,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string var _result = new CompleteOrders(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -372,7 +372,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject(_json_value.Content); { diff --git a/src/exchanges/chn/huobi/trade/tradeApi.cs b/src/exchanges/chn/huobi/trade/tradeApi.cs index ec3418c..5e8d5fd 100644 --- a/src/exchanges/chn/huobi/trade/tradeApi.cs +++ b/src/exchanges/chn/huobi/trade/tradeApi.cs @@ -68,7 +68,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -79,7 +79,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orderItem = tradeClient.DeserializeObject(_json_value.Content); { @@ -114,7 +114,7 @@ public override async ValueTask FetchMyOrdersAsync(string base_name, s var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -134,7 +134,7 @@ public override async ValueTask FetchMyOrdersAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { @@ -173,7 +173,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { if (args.ContainsKey("account-id") && args["account-id"].ToString() != "") { @@ -192,7 +192,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orders = tradeClient.DeserializeObject(_json_value.Content); { @@ -237,7 +237,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s var _result = new MyTrades(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -257,7 +257,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { @@ -300,7 +300,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { if (args.ContainsKey("account-id") && args["account-id"].ToString() != "") { @@ -325,7 +325,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -372,7 +372,7 @@ public override async ValueTask CreateMarketOrderAsync(string base_name var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { if (args.ContainsKey("account-id") && args["account-id"].ToString() != "") { @@ -396,7 +396,7 @@ public override async ValueTask CreateMarketOrderAsync(string base_name _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -444,7 +444,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -455,7 +455,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { @@ -500,7 +500,7 @@ public override async ValueTask CancelOrdersAsync(string base_name, st var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { if (order_ids.Length > 0) { @@ -518,11 +518,11 @@ public override async ValueTask CancelOrdersAsync(string base_name, st _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { - if (_json_data.success == true) + if (_json_data.success) { foreach (var _cancelOrder in _json_data.result) { @@ -557,11 +557,11 @@ public override async ValueTask CancelOrdersAsync(string base_name, st _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { - if (_json_data.success == true) + if (_json_data.success) { _result.result.Add(_json_data.result); } @@ -598,7 +598,7 @@ public override async ValueTask CancelAllOrdersAsync(Dictionary CancelAllOrdersAsync(Dictionary(_json_value.Content); { - if (_json_data.success == true) + if (_json_data.success) { _result.result.Add(_json_data.result); } diff --git a/src/exchanges/chn/okex/okex.cs b/src/exchanges/chn/okex/okex.cs index 1ed5376..d92f2f7 100644 --- a/src/exchanges/chn/okex/okex.cs +++ b/src/exchanges/chn/okex/okex.cs @@ -185,7 +185,7 @@ public MD5 MD5Crypto var _result = (endPoint: spot_url, args); var _omarket = market as OMarketItem; - if (_omarket.future == true) + if (_omarket.future) { _result.endPoint = futures_url; @@ -206,7 +206,7 @@ public override async ValueTask CreatePostRequestAsync(string endpo { var _request = await base.CreatePostRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _params = new Dictionary(); { @@ -229,7 +229,7 @@ public override async ValueTask CreatePostRequestAsync(string endpo _post_data += $"&sign={_signature.ToUpper()}"; } - _request.AddParameter("application/x-www-form-urlencoded", _post_data, ParameterType.RequestBody); + _request.AddParameter("application/x-www-form-urlencoded", _post_data, ParameterType.RequestBody); } return await Task.FromResult(_request); @@ -268,7 +268,7 @@ public override async ValueTask CreatePostRequestAsync(string endpo /// public new ErrorCode GetErrorMessage(int error_code) { - return ErrorMessages.ContainsKey(error_code) == true + return ErrorMessages.ContainsKey(error_code) ? ErrorMessages[error_code] : ErrorCode.ExchangeError; } @@ -295,7 +295,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) if (_json_error != null) { var _error_number = _json_error.Value(); - if (ErrorMessages.ContainsKey(_error_number) == true) + if (ErrorMessages.ContainsKey(_error_number)) _error_code = GetErrorMessage(_error_number); _result.SetFailure(_error_msg, _error_code, _error_number); @@ -311,7 +311,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) } } - if (_result.success == true && response.IsSuccessful == false) + if (_result.success && response.IsSuccessful == false) { _result.SetFailure( response.ErrorMessage ?? response.StatusDescription, diff --git a/src/exchanges/chn/okex/private/privateApi.cs b/src/exchanges/chn/okex/private/privateApi.cs index 194b576..24ecd00 100644 --- a/src/exchanges/chn/okex/private/privateApi.cs +++ b/src/exchanges/chn/okex/private/privateApi.cs @@ -72,7 +72,7 @@ public override async ValueTask CoinWithdrawAsync(string currency_name var _result = new Transfer(); var _market = await publicApi.LoadMarketAsync(_result.MakeMarketId(currency_name, "USDT")); - if (_market.success == true) + if (_market.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -92,10 +92,10 @@ public override async ValueTask CoinWithdrawAsync(string currency_name _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _withdraw = new OTransferItem { @@ -146,7 +146,7 @@ public override async ValueTask CancelCoinWithdrawAsync(string currenc var _result = new Transfer(); var _market = await publicApi.LoadMarketAsync(_result.MakeMarketId(currency_name, "USDT")); - if (_market.success == true) + if (_market.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -163,10 +163,10 @@ public override async ValueTask CancelCoinWithdrawAsync(string currenc _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _transfer = new OTransferItem { @@ -215,7 +215,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n var _result = new Transfers(); var _market = await publicApi.LoadMarketAsync(_result.MakeMarketId(currency_name, "USD")); - if (_market.success == true) + if (_market.success) { var _timestamp = privateClient.ExchangeInfo.GetTimestamp(timeframe); var _timeframe = privateClient.ExchangeInfo.GetTimeframe(timeframe); @@ -239,7 +239,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n _result.rawJson += _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_deposits = privateClient.DeserializeObject(_json_value.Content); { @@ -265,7 +265,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n _params.Add("type", 1); // 0:deposits 1 :withdraw // TransactionType.Withdrawal - if (_result.success == true) + if (_result.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -274,7 +274,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n _result.rawJson += _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_withdraws = privateClient.DeserializeObject(_json_value.Content); { @@ -316,7 +316,7 @@ public override async ValueTask FetchBalanceAsync(string base_name, str var _result = new Balance(); var _currency_id = await publicApi.LoadCurrencyIdAsync(base_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -327,12 +327,12 @@ public override async ValueTask FetchBalanceAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); { var _balances = privateClient.DeserializeObject>(_json_data["info"]["funds"].ToString()); - if (_balances["free"].ContainsKey(_currency_id.result) == true) + if (_balances["free"].ContainsKey(_currency_id.result)) { var _balance = new OBalanceItem() { @@ -372,7 +372,7 @@ public override async ValueTask FetchBalancesAsync(Dictionary FetchBalancesAsync(Dictionary(_json_value.Content); { diff --git a/src/exchanges/chn/okex/public/publicApi.cs b/src/exchanges/chn/okex/public/publicApi.cs index 36c3b83..a1b0198 100644 --- a/src/exchanges/chn/okex/public/publicApi.cs +++ b/src/exchanges/chn/okex/public/publicApi.cs @@ -76,7 +76,7 @@ public override async ValueTask FetchMarketsAsync(Dictionary(_json_value.Content); foreach (var _m in _markets.result) @@ -132,7 +132,7 @@ public override async ValueTask FetchMarketsAsync(Dictionary FetchTickerAsync(string base_name, strin var _result = new Ticker(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { okexapiClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -199,7 +199,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = okexapiClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = okexapiClient.DeserializeObject(_json_value.Content); { @@ -232,7 +232,7 @@ public override async ValueTask FetchTickersAsync(Dictionary FetchTickersAsync(Dictionary(_json_value.Content); { @@ -278,7 +278,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam var _result = new OrderBooks(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { okexapiClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -297,7 +297,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam _result.rawJson = _json_value.Content; #endif var _json_result = okexapiClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orderbook = okexapiClient.DeserializeObject(_json_value.Content); { @@ -335,7 +335,7 @@ public override async ValueTask FetchOHLCVsAsync(string base_name, strin var _result = new OHLCVs(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { okexapiClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -361,7 +361,7 @@ public override async ValueTask FetchOHLCVsAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = okexapiClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = okexapiClient.DeserializeObject>(_json_value.Content); @@ -407,7 +407,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string var _result = new CompleteOrders(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { okexapiClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -428,7 +428,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string _result.rawJson = _json_value.Content; #endif var _json_result = okexapiClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = okexapiClient.DeserializeObject>(_json_value.Content); { diff --git a/src/exchanges/chn/okex/trade/tradeApi.cs b/src/exchanges/chn/okex/trade/tradeApi.cs index 99b34f2..23e66b7 100644 --- a/src/exchanges/chn/okex/trade/tradeApi.cs +++ b/src/exchanges/chn/okex/trade/tradeApi.cs @@ -82,7 +82,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { okexClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -101,10 +101,10 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = okexClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = okexClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _orders = _json_data.result.Where(o => o.orderId == order_id); if (_orders.Count() > 0) @@ -148,7 +148,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { okexClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -167,10 +167,10 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = okexClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = okexClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _orders = _json_data.result .Where(o => o.symbol == _market.result.symbol) @@ -213,7 +213,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s var _result = new MyTrades(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { okexClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -237,10 +237,10 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = okexClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = okexClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _trades = _json_data.result .Where(t => t.timestamp >= since) @@ -286,7 +286,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { okexClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -309,11 +309,11 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = okexClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = okexClient.DeserializeObject(_json_value.Content); - if (_json_data.result == true) + if (_json_data.result) { var _order = new OPlaceOrderItem { @@ -361,7 +361,7 @@ public override async ValueTask CreateMarketOrderAsync(string base_name var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { okexClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -383,11 +383,11 @@ public override async ValueTask CreateMarketOrderAsync(string base_name _result.rawJson = _json_value.Content; #endif var _json_result = okexClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = okexClient.DeserializeObject(_json_value.Content); - if (_json_data.result == true) + if (_json_data.result) { var _order = new OPlaceOrderItem { @@ -436,7 +436,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { okexClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -455,7 +455,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri _result.rawJson = _json_value.Content; #endif var _json_result = okexClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = okexClient.DeserializeObject(_json_value.Content); { @@ -523,7 +523,7 @@ public override async ValueTask CancelOrdersAsync(string base_name, st var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { okexClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -542,7 +542,7 @@ public override async ValueTask CancelOrdersAsync(string base_name, st _result.rawJson = _json_value.Content; #endif var _json_result = okexClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = okexClient.DeserializeObject(_json_value.Content); { diff --git a/src/exchanges/chn/zb/private/privateApi.cs b/src/exchanges/chn/zb/private/privateApi.cs index feba3fb..23e6749 100644 --- a/src/exchanges/chn/zb/private/privateApi.cs +++ b/src/exchanges/chn/zb/private/privateApi.cs @@ -65,7 +65,7 @@ public override async ValueTask
FetchAddressAsync(string currency_name, var _result = new Address(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -82,7 +82,7 @@ public override async ValueTask
FetchAddressAsync(string currency_name, _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); { @@ -117,7 +117,7 @@ public override async ValueTask CoinWithdrawAsync(string currency_name var _result = new Transfer(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -138,7 +138,7 @@ public override async ValueTask CoinWithdrawAsync(string currency_name _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); { @@ -193,7 +193,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n var _result = new Transfers(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { var _params = new Dictionary(); { @@ -214,7 +214,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n _result.rawJson += _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); { @@ -226,7 +226,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n foreach (var _d in _deposits) { #if DEBUG - if (String.IsNullOrEmpty(_d.transactionId) == true) + if (String.IsNullOrEmpty(_d.transactionId)) continue; #endif _d.transactionType = TransactionType.Deposit; @@ -244,7 +244,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n _params.Add("method", "getWithdrawRecord"); // TransactionType.Withdrawal - if (_result.success == true) + if (_result.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -253,7 +253,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n _result.rawJson += _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); { @@ -294,7 +294,7 @@ public override async ValueTask FetchBalancesAsync(Dictionary FetchBalancesAsync(Dictionary(_json_value.Content); { diff --git a/src/exchanges/chn/zb/public/publicApi.cs b/src/exchanges/chn/zb/public/publicApi.cs index 0f6d943..2bf8353 100644 --- a/src/exchanges/chn/zb/public/publicApi.cs +++ b/src/exchanges/chn/zb/public/publicApi.cs @@ -69,7 +69,7 @@ public override async ValueTask FetchMarketsAsync(Dictionary>(_json_value.Content); @@ -129,7 +129,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin var _result = new Ticker(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -145,7 +145,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _ticker = publicClient.DeserializeObject(_json_value.Content); { @@ -175,7 +175,7 @@ public override async ValueTask FetchTickersAsync(Dictionary FetchTickersAsync(Dictionary>(_json_value.Content); { @@ -224,7 +224,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam var _result = new OrderBooks(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -241,7 +241,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _ob = publicClient.DeserializeObject(_json_value.Content); { @@ -303,7 +303,7 @@ public override async ValueTask FetchOHLCVsAsync(string base_name, strin var _result = new OHLCVs(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -326,10 +326,10 @@ public override async ValueTask FetchOHLCVsAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _ohlcvs = publicClient.DeserializeObject(_json_value.Content); - if (_ohlcvs.success == true) + if (_ohlcvs.success) { _result.result.AddRange( _ohlcvs.result @@ -369,7 +369,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string var _result = new CompleteOrders(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -388,7 +388,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject>(_json_value.Content); { diff --git a/src/exchanges/chn/zb/trade/tradeApi.cs b/src/exchanges/chn/zb/trade/tradeApi.cs index 85264eb..27cfead 100644 --- a/src/exchanges/chn/zb/trade/tradeApi.cs +++ b/src/exchanges/chn/zb/trade/tradeApi.cs @@ -66,7 +66,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -84,7 +84,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -120,7 +120,7 @@ public override async ValueTask FetchMyOrdersAsync(string base_name, s var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -142,7 +142,7 @@ public override async ValueTask FetchMyOrdersAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); { @@ -181,7 +181,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -200,7 +200,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orders = tradeClient.DeserializeObject>(_json_value.Content); { @@ -238,7 +238,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -260,7 +260,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -307,7 +307,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -325,10 +325,10 @@ public override async ValueTask CancelOrderAsync(string base_name, stri _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _order = new ZPlaceOrderItem { diff --git a/src/exchanges/chn/zb/zb.cs b/src/exchanges/chn/zb/zb.cs index 01ed7ad..e311d54 100644 --- a/src/exchanges/chn/zb/zb.cs +++ b/src/exchanges/chn/zb/zb.cs @@ -233,7 +233,7 @@ public override async ValueTask CreateGetRequestAsync(string endpoi { var _request = await base.CreateGetRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _params = new Dictionary(); { @@ -303,7 +303,7 @@ public override async ValueTask CreateGetRequestAsync(string endpoi /// public override string GetErrorMessage(int error_code) { - return ErrorMessages.ContainsKey(error_code) == true + return ErrorMessages.ContainsKey(error_code) ? ErrorMessages[error_code] : "failure"; } @@ -319,7 +319,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) if (response != null) { - if (response.IsSuccessful == true) + if (response.IsSuccessful) { var _json_result = this.DeserializeObject(response.Content); @@ -338,7 +338,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) } } - if (_result.success == true && response.IsSuccessful == false) + if (_result.success && response.IsSuccessful == false) { _result.SetFailure( response.ErrorMessage ?? response.StatusDescription, diff --git a/src/exchanges/gbr/bitfinex/bitfinex.cs b/src/exchanges/gbr/bitfinex/bitfinex.cs index b62967f..c7dd0c4 100644 --- a/src/exchanges/gbr/bitfinex/bitfinex.cs +++ b/src/exchanges/gbr/bitfinex/bitfinex.cs @@ -234,7 +234,7 @@ public override async ValueTask CreatePostRequestAsync(string endpo { var _request = await base.CreatePostRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _params = new Dictionary(); { @@ -348,7 +348,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) } } - if (_result.success == true && response.IsSuccessful == false) + if (_result.success && response.IsSuccessful == false) { _result.SetFailure( response.ErrorMessage ?? response.StatusDescription, diff --git a/src/exchanges/gbr/bitfinex/private/privateApi.cs b/src/exchanges/gbr/bitfinex/private/privateApi.cs index 49da23f..2b054ed 100644 --- a/src/exchanges/gbr/bitfinex/private/privateApi.cs +++ b/src/exchanges/gbr/bitfinex/private/privateApi.cs @@ -64,7 +64,7 @@ public override async ValueTask
CreateAddressAsync(string currency_name var _result = new Address(); var _currency_nick = await publicApi.LoadCurrencyNickAsync(currency_name); - if (_currency_nick.success == true) + if (_currency_nick.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -82,7 +82,7 @@ public override async ValueTask
CreateAddressAsync(string currency_name _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _address = privateClient.DeserializeObject(_json_value.Content); { @@ -121,7 +121,7 @@ public override async ValueTask
FetchAddressAsync(string currency_name, var _result = new Address(); var _currency_nick = await publicApi.LoadCurrencyNickAsync(currency_name); - if (_currency_nick.success == true) + if (_currency_nick.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -139,7 +139,7 @@ public override async ValueTask
FetchAddressAsync(string currency_name, _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _address = privateClient.DeserializeObject(_json_value.Content); { @@ -179,7 +179,7 @@ public override async ValueTask CoinWithdrawAsync(string currency_name var _result = new Transfer(); var _currency_nick = await publicApi.LoadCurrencyNickAsync(currency_name); - if (_currency_nick.success == true) + if (_currency_nick.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -198,10 +198,10 @@ public override async ValueTask CoinWithdrawAsync(string currency_name _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _withdraw = new BTransferItem { @@ -254,7 +254,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n var _result = new Transfers(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -275,7 +275,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject>(_json_value.Content); { @@ -325,7 +325,7 @@ public override async ValueTask FetchBalanceAsync(string base_name, str var _result = new Balance(); var _currency_id = await publicApi.LoadCurrencyIdAsync(base_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -336,7 +336,7 @@ public override async ValueTask FetchBalanceAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _balances = privateClient.DeserializeObject>(_json_value.Content); { @@ -374,7 +374,7 @@ public override async ValueTask FetchBalancesAsync(Dictionary FetchBalancesAsync(Dictionary>(_json_value.Content); { diff --git a/src/exchanges/gbr/bitfinex/public/publicApi.cs b/src/exchanges/gbr/bitfinex/public/publicApi.cs index 5976685..291af1e 100644 --- a/src/exchanges/gbr/bitfinex/public/publicApi.cs +++ b/src/exchanges/gbr/bitfinex/public/publicApi.cs @@ -54,7 +54,7 @@ public override async ValueTask FetchMarketsAsync(Dictionary(_json_value.Content); @@ -140,7 +140,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin var _result = new Ticker(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -151,7 +151,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _ticker = publicClient.DeserializeObject(_json_value.Content); { @@ -180,7 +180,7 @@ public override async ValueTask FetchTickersAsync(Dictionary FetchTickersAsync(Dictionary>(_json_value.Content); { @@ -227,7 +227,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam var _result = new OrderBooks(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -248,7 +248,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orderbook = publicClient.DeserializeObject(_json_value.Content); { @@ -286,7 +286,7 @@ public override async ValueTask FetchOHLCVsAsync(string base_name, strin var _result = new OHLCVs(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -316,7 +316,7 @@ public override async ValueTask FetchOHLCVsAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject>(_json_value.Content); @@ -362,7 +362,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string var _result = new CompleteOrders(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -390,7 +390,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject>(_json_value.Content); { diff --git a/src/exchanges/gbr/bitfinex/trade/order.cs b/src/exchanges/gbr/bitfinex/trade/order.cs index ab915df..44106d4 100644 --- a/src/exchanges/gbr/bitfinex/trade/order.cs +++ b/src/exchanges/gbr/bitfinex/trade/order.cs @@ -111,9 +111,9 @@ public override OrderStatus orderStatus { get { - base.orderStatus = (is_live == true && filled == 0) ? OrderStatus.Open - : (is_live == true && filled > 0) ? OrderStatus.Partially - : is_cancelled == true ? OrderStatus.Canceled + base.orderStatus = (is_live && filled == 0) ? OrderStatus.Open + : (is_live && filled > 0) ? OrderStatus.Partially + : is_cancelled ? OrderStatus.Canceled : OrderStatus.Closed; return base.orderStatus; diff --git a/src/exchanges/gbr/bitfinex/trade/place.cs b/src/exchanges/gbr/bitfinex/trade/place.cs index ca9e829..cb69e56 100644 --- a/src/exchanges/gbr/bitfinex/trade/place.cs +++ b/src/exchanges/gbr/bitfinex/trade/place.cs @@ -78,8 +78,8 @@ public override OrderStatus orderStatus { get { - base.orderStatus = statusLive == true ? OrderStatus.Open - : statusCanceled == true ? OrderStatus.Canceled + base.orderStatus = statusLive ? OrderStatus.Open + : statusCanceled ? OrderStatus.Canceled : OrderStatus.Closed; return base.orderStatus; diff --git a/src/exchanges/gbr/bitfinex/trade/tradeApi.cs b/src/exchanges/gbr/bitfinex/trade/tradeApi.cs index 93763b6..d634686 100644 --- a/src/exchanges/gbr/bitfinex/trade/tradeApi.cs +++ b/src/exchanges/gbr/bitfinex/trade/tradeApi.cs @@ -68,7 +68,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -84,7 +84,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orderItem = tradeClient.DeserializeObject(_json_value.Content); { @@ -119,7 +119,7 @@ public override async ValueTask FetchMyOrdersAsync(string base_name, s var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -133,7 +133,7 @@ public override async ValueTask FetchMyOrdersAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); { @@ -170,7 +170,7 @@ public override async ValueTask FetchAllOpenOrdersAsync(Dictionary FetchAllOpenOrdersAsync(Dictionary>(_json_value.Content); foreach (var _o in _orders) @@ -211,7 +211,7 @@ public override async ValueTask FetchAllOpenPositionsAsync(Dictiona var _result = new MyPositions(); var _markets = await publicApi.LoadMarketsAsync(); - if (_markets.success == true) + if (_markets.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -222,7 +222,7 @@ public override async ValueTask FetchAllOpenPositionsAsync(Dictiona _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); { @@ -262,7 +262,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s var _result = new MyTrades(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -282,7 +282,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); { @@ -324,7 +324,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -349,7 +349,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -386,7 +386,7 @@ public override async ValueTask CreateMarketOrderAsync(string base_name var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -411,7 +411,7 @@ public override async ValueTask CreateMarketOrderAsync(string base_name _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -449,7 +449,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -465,7 +465,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { @@ -510,7 +510,7 @@ public override async ValueTask CancelOrdersAsync(string base_name, st var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -526,7 +526,7 @@ public override async ValueTask CancelOrdersAsync(string base_name, st _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { @@ -559,7 +559,7 @@ public override async ValueTask CancelAllOrdersAsync(Dictionary CancelAllOrdersAsync(Dictionary(_json_value.Content); { diff --git a/src/exchanges/gbr/bitstamp/bitstamp.cs b/src/exchanges/gbr/bitstamp/bitstamp.cs index e51f027..1c75c85 100644 --- a/src/exchanges/gbr/bitstamp/bitstamp.cs +++ b/src/exchanges/gbr/bitstamp/bitstamp.cs @@ -134,7 +134,7 @@ public override async ValueTask CreatePostRequestAsync(string endpo { var _request = await base.CreatePostRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _nonce = GenerateOnlyNonce(13); var _sign_data = $"{_nonce}{UserName}{ConnectKey}"; @@ -183,7 +183,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) var _error = _json_error.Value(); if (String.IsNullOrEmpty(_error) == false) { - if (ErrorMessages.ContainsKey(_error) == true) + if (ErrorMessages.ContainsKey(_error)) _error_code = ErrorMessages[_error]; _error_msg = _error; @@ -192,7 +192,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) _result.SetFailure(_error_msg, _error_code); } - if (_result.success == true) + if (_result.success) { var _json_status = _json_result.SelectToken("status"); if (_json_status != null) @@ -217,7 +217,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) } } - if (_result.success == true && response.IsSuccessful == false) + if (_result.success && response.IsSuccessful == false) { _result.SetFailure( response.ErrorMessage ?? response.StatusDescription, diff --git a/src/exchanges/gbr/bitstamp/private/privateApi.cs b/src/exchanges/gbr/bitstamp/private/privateApi.cs index c4f6ec4..e775339 100644 --- a/src/exchanges/gbr/bitstamp/private/privateApi.cs +++ b/src/exchanges/gbr/bitstamp/private/privateApi.cs @@ -69,7 +69,7 @@ public override async ValueTask
FetchAddressAsync(string currency_name, var _result = new Address(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -86,7 +86,7 @@ public override async ValueTask
FetchAddressAsync(string currency_name, _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _address = _json_value.Content; { @@ -119,7 +119,7 @@ public override async ValueTask CoinWithdrawAsync(string currency_name var _result = new Transfer(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -139,7 +139,7 @@ public override async ValueTask CoinWithdrawAsync(string currency_name _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); if (String.IsNullOrEmpty(_json_data.transferId) == false) @@ -194,7 +194,7 @@ public override async ValueTask FetchAllTransfersAsync(string timefra var _result = new Transfers(); var _markets = await publicApi.LoadMarketsAsync(); - if (_markets.success == true) + if (_markets.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -212,7 +212,7 @@ public override async ValueTask FetchAllTransfersAsync(string timefra _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject>(_json_value.Content); foreach (var _t in _json_data) @@ -238,7 +238,7 @@ public override async ValueTask FetchAllTransfersAsync(string timefra } } - if (String.IsNullOrEmpty(_currency) == true) + if (String.IsNullOrEmpty(_currency)) continue; var _transaction_id = _t["id"].Value(); @@ -305,7 +305,7 @@ public override async ValueTask FetchBalanceAsync(string base_name, str var _result = new Balance(); var _market = await publicApi.LoadMarketAsync(_result.MakeMarketId(base_name, quote_name)); - if (_market.success == true) + if (_market.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -316,7 +316,7 @@ public override async ValueTask FetchBalanceAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _balances = privateClient.DeserializeObject(_json_value.Content); { @@ -357,7 +357,7 @@ public override async ValueTask FetchBalancesAsync(Dictionary FetchBalancesAsync(Dictionary(_json_value.Content); { diff --git a/src/exchanges/gbr/bitstamp/public/publicApi.cs b/src/exchanges/gbr/bitstamp/public/publicApi.cs index 3c13d20..f8fdf41 100644 --- a/src/exchanges/gbr/bitstamp/public/publicApi.cs +++ b/src/exchanges/gbr/bitstamp/public/publicApi.cs @@ -53,7 +53,7 @@ public override async ValueTask FetchMarketsAsync(Dictionary>(_json_value.Content); foreach (var _market in _pairs_info) @@ -141,7 +141,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin var _result = new Ticker(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -152,7 +152,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _ticker = publicClient.DeserializeObject(_json_value.Content); { @@ -184,7 +184,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam var _result = new OrderBooks(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -195,7 +195,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orderbook = publicClient.DeserializeObject(_json_value.Content); { @@ -233,7 +233,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string var _result = new CompleteOrders(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -247,7 +247,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject>(_json_value.Content); { diff --git a/src/exchanges/gbr/bitstamp/trade/tradeApi.cs b/src/exchanges/gbr/bitstamp/trade/tradeApi.cs index a0ac075..1e93fba 100644 --- a/src/exchanges/gbr/bitstamp/trade/tradeApi.cs +++ b/src/exchanges/gbr/bitstamp/trade/tradeApi.cs @@ -71,7 +71,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -88,7 +88,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { @@ -158,7 +158,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -169,7 +169,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orders = tradeClient.DeserializeObject>(_json_value.Content); { @@ -203,7 +203,7 @@ public override async ValueTask FetchAllOpenOrdersAsync(Dictionary FetchAllOpenOrdersAsync(Dictionary>(_json_value.Content); { @@ -263,7 +263,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s var _result = new MyTrades(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -285,7 +285,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); foreach (var _j in _json_data) @@ -334,7 +334,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -354,7 +354,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { @@ -397,7 +397,7 @@ public override async ValueTask CreateMarketOrderAsync(string base_name var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -416,7 +416,7 @@ public override async ValueTask CreateMarketOrderAsync(string base_name _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { @@ -460,7 +460,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -477,7 +477,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { @@ -508,7 +508,7 @@ public override async ValueTask CancelAllOrdersAsync(Dictionary CancelAllOrdersAsync(Dictionary CreatePostRequestAsync(string endpo { var _request = await base.CreatePostRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _nonce = GenerateOnlyNonce(10).ToString(); @@ -181,7 +181,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) if (response != null) { - if (response.IsSuccessful == true) + if (response.IsSuccessful) { var _json_result = this.DeserializeObject(response.Content); @@ -194,7 +194,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) var _error = _json_error.Value(); if (String.IsNullOrEmpty(_error) == false) { - if (ErrorMessages.ContainsKey(_error) == true) + if (ErrorMessages.ContainsKey(_error)) _error_code = ErrorMessages[_error]; _error_msg = _error; @@ -204,7 +204,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) } } - if (_result.success == true && response.IsSuccessful == false) + if (_result.success && response.IsSuccessful == false) { _result.SetFailure( response.ErrorMessage ?? response.StatusDescription, diff --git a/src/exchanges/gbr/cexio/private/privateApi.cs b/src/exchanges/gbr/cexio/private/privateApi.cs index 3bc3461..96561e3 100644 --- a/src/exchanges/gbr/cexio/private/privateApi.cs +++ b/src/exchanges/gbr/cexio/private/privateApi.cs @@ -67,7 +67,7 @@ public override async ValueTask
FetchAddressAsync(string currency_name, var _result = new Address(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -83,7 +83,7 @@ public override async ValueTask
FetchAddressAsync(string currency_name, _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _address = privateClient.DeserializeObject(_json_value.Content); { @@ -114,7 +114,7 @@ public override async ValueTask FetchBalanceAsync(string base_name, str var _result = new Balance(); var _currency_id = await publicApi.LoadCurrencyIdAsync(base_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -125,7 +125,7 @@ public override async ValueTask FetchBalanceAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _balances = privateClient.DeserializeObject(_json_value.Content); { @@ -172,7 +172,7 @@ public override async ValueTask FetchBalancesAsync(Dictionary FetchBalancesAsync(Dictionary(_json_value.Content); { diff --git a/src/exchanges/gbr/cexio/public/publicApi.cs b/src/exchanges/gbr/cexio/public/publicApi.cs index dca2ecd..f765092 100644 --- a/src/exchanges/gbr/cexio/public/publicApi.cs +++ b/src/exchanges/gbr/cexio/public/publicApi.cs @@ -55,7 +55,7 @@ public override async ValueTask FetchMarketsAsync(Dictionary(_json_value.Content); @@ -67,7 +67,7 @@ public override async ValueTask FetchMarketsAsync(Dictionary FetchTickerAsync(string base_name, strin var _result = new Ticker(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -151,7 +151,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _ticker = publicClient.DeserializeObject(_json_value.Content); { @@ -180,7 +180,7 @@ public override async ValueTask FetchTickersAsync(Dictionary FetchTickersAsync(Dictionary(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { foreach (var _ticker in _json_data.result) { @@ -240,7 +240,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam var _result = new OrderBooks(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -257,7 +257,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orderbook = publicClient.DeserializeObject(_json_value.Content); { @@ -295,7 +295,7 @@ public override async ValueTask FetchOHLCVsAsync(string base_name, strin var _result = new OHLCVs(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -312,10 +312,10 @@ public override async ValueTask FetchOHLCVsAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject>(_json_value.Content); - if (_json_data.ContainsKey(_dataframe) == true) + if (_json_data.ContainsKey(_dataframe)) { var _candles = publicClient.DeserializeObject(_json_data[_dataframe].ToString()); @@ -366,7 +366,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string var _result = new CompleteOrders(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -380,7 +380,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject>(_json_value.Content); { diff --git a/src/exchanges/gbr/cexio/trade/trade.cs b/src/exchanges/gbr/cexio/trade/trade.cs index 8158a51..a7639f8 100644 --- a/src/exchanges/gbr/cexio/trade/trade.cs +++ b/src/exchanges/gbr/cexio/trade/trade.cs @@ -77,7 +77,7 @@ private bool sideValue { set { - sideType = (value == true) ? SideType.Bid : SideType.Ask; + sideType = (value) ? SideType.Bid : SideType.Ask; } } } diff --git a/src/exchanges/gbr/cexio/trade/tradeApi.cs b/src/exchanges/gbr/cexio/trade/tradeApi.cs index c5ecf36..9473d16 100644 --- a/src/exchanges/gbr/cexio/trade/tradeApi.cs +++ b/src/exchanges/gbr/cexio/trade/tradeApi.cs @@ -72,7 +72,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -88,7 +88,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); if (_order != null) @@ -127,7 +127,7 @@ public override async ValueTask FetchMyOrdersAsync(string base_name, s var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -141,7 +141,7 @@ public override async ValueTask FetchMyOrdersAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); { @@ -180,7 +180,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -191,7 +191,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orders = tradeClient.DeserializeObject>(_json_value.Content); { @@ -224,7 +224,7 @@ public override async ValueTask FetchAllOpenOrdersAsync(Dictionary FetchAllOpenOrdersAsync(Dictionary>(_json_value.Content); { @@ -268,7 +268,7 @@ public override async ValueTask FetchAllOpenPositionsAsync(Dictiona var _result = new MyPositions(); var _markets = await publicApi.LoadMarketsAsync(); - if (_markets.success == true) + if (_markets.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -279,7 +279,7 @@ public override async ValueTask FetchAllOpenPositionsAsync(Dictiona _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { @@ -321,7 +321,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -342,7 +342,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -379,7 +379,7 @@ public override async ValueTask CreateMarketOrderAsync(string base_name var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -400,7 +400,7 @@ public override async ValueTask CreateMarketOrderAsync(string base_name _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); // limit order랑 넘어오는 데이터가 다름 { @@ -438,7 +438,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -454,11 +454,11 @@ public override async ValueTask CancelOrderAsync(string base_name, stri _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { - if (_json_data == true) + if (_json_data) { var _order = new CMyOrderItem { @@ -506,7 +506,7 @@ public override async ValueTask CancelOrdersAsync(string base_name, st var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -517,7 +517,7 @@ public override async ValueTask CancelOrdersAsync(string base_name, st _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { diff --git a/src/exchanges/hk/binance/binance.cs b/src/exchanges/hk/binance/binance.cs index da05f52..0e9d884 100644 --- a/src/exchanges/hk/binance/binance.cs +++ b/src/exchanges/hk/binance/binance.cs @@ -171,7 +171,7 @@ public override async ValueTask CreatePostRequestAsync(string endpo { var _request = await base.CreatePostRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _params = new Dictionary(); { @@ -208,7 +208,7 @@ public override async ValueTask CreateGetRequestAsync(string endpoi { var _request = await base.CreateGetRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { _request.AddParameter("recvWindow", 60 * 1000); _request.AddParameter("timestamp", CUnixTime.NowMilli); @@ -237,7 +237,7 @@ public override async ValueTask CreateDeleteRequestAsync(string end { var _request = await base.CreateDeleteRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _params = new Dictionary(); { @@ -347,13 +347,13 @@ public override BoolResult GetResponseMessage(RestResponse response = null) { _result.statusCode = _json_error.Value(); - if (ErrorMessages.ContainsKey(_result.statusCode) == true) + if (ErrorMessages.ContainsKey(_result.statusCode)) { // a workaround for {"code":-2015,"msg":"Invalid API-key, IP, or permissions for action."} // despite that their message is very confusing, it is raised by Binance // on a temporary ban (the API key is valid, but disabled for a while) - if (_result.statusCode == -2015 && this.ExchangeInfo.Options.hasAlreadyAuthenticatedSuccessfully == true) + if (_result.statusCode == -2015 && this.ExchangeInfo.Options.hasAlreadyAuthenticatedSuccessfully) { _error_code = ErrorCode.DDoSProtection; _error_msg = "temporary banned: " + response.Content; @@ -406,7 +406,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) if (_error_code != ErrorCode.Success) _result.SetFailure(_error_msg, _error_code); - if (_result.success == true && response.IsSuccessful == false) + if (_result.success && response.IsSuccessful == false) { _result.SetFailure( response.ErrorMessage ?? response.StatusDescription, diff --git a/src/exchanges/hk/binance/private/privateApi.cs b/src/exchanges/hk/binance/private/privateApi.cs index f4e4696..0a62000 100644 --- a/src/exchanges/hk/binance/private/privateApi.cs +++ b/src/exchanges/hk/binance/private/privateApi.cs @@ -82,7 +82,7 @@ public override async ValueTask
FetchAddressAsync(string currency_name, var _result = new Address(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -98,7 +98,7 @@ public override async ValueTask
FetchAddressAsync(string currency_name, _result.rawJson = _json_value.Content; #endif var _json_result = priwapiClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = priwapiClient.DeserializeObject(_json_value.Content); { @@ -131,7 +131,7 @@ public override async ValueTask CoinWithdrawAsync(string currency_name var _result = new Transfer(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -154,10 +154,10 @@ public override async ValueTask CoinWithdrawAsync(string currency_name _result.rawJson = _json_value.Content; #endif var _json_result = priwapiClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = priwapiClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _withdraw = new BWithdrawItem { @@ -211,7 +211,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n var _result = new Transfers(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { var _timestamp = privateClient.ExchangeInfo.GetTimestamp(timeframe); var _timeframe = privateClient.ExchangeInfo.GetTimeframe(timeframe); @@ -233,10 +233,10 @@ public override async ValueTask FetchTransfersAsync(string currency_n _result.rawJson += _json_value.Content; #endif var _json_result = priwapiClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = priwapiClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _deposits = _json_data.result .Where(t => t.timestamp >= since) @@ -260,7 +260,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n } // TransactionType.Withdrawal - if (_result.success == true) + if (_result.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -269,7 +269,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n _result.rawJson += _json_value.Content; #endif var _json_result = priwapiClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_withdraws = priwapiClient.DeserializeObject(_json_value.Content); { @@ -315,7 +315,7 @@ public override async ValueTask FetchAllTransfersAsync(string timefra var _result = new Transfers(); var _markets = await publicApi.LoadMarketsAsync(); - if (_markets.success == true) + if (_markets.success) { var _timestamp = privateClient.ExchangeInfo.GetTimestamp(timeframe); var _timeframe = privateClient.ExchangeInfo.GetTimeframe(timeframe); @@ -340,7 +340,7 @@ public override async ValueTask FetchAllTransfersAsync(string timefra _result.rawJson += _json_value.Content; #endif var _json_result = priwapiClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_deposits = priwapiClient.DeserializeObject(_json_value.Content); { @@ -365,7 +365,7 @@ public override async ValueTask FetchAllTransfersAsync(string timefra } // TransactionType.Withdrawal - if (_result.success == true) + if (_result.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -374,7 +374,7 @@ public override async ValueTask FetchAllTransfersAsync(string timefra _result.rawJson += _json_value.Content; #endif var _json_result = priwapiClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_withdraws = priwapiClient.DeserializeObject(_json_value.Content); { @@ -418,7 +418,7 @@ public override async ValueTask FetchBalanceAsync(string base_name, str var _result = new Balance(); var _currency_id = await publicApi.LoadCurrencyIdAsync(base_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -429,7 +429,7 @@ public override async ValueTask FetchBalanceAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); { @@ -468,7 +468,7 @@ public override async ValueTask FetchBalancesAsync(Dictionary FetchBalancesAsync(Dictionary(_json_value.Content); { diff --git a/src/exchanges/hk/binance/public/publicApi.cs b/src/exchanges/hk/binance/public/publicApi.cs index 5112344..62a3b84 100644 --- a/src/exchanges/hk/binance/public/publicApi.cs +++ b/src/exchanges/hk/binance/public/publicApi.cs @@ -55,7 +55,7 @@ public override async ValueTask FetchMarketsAsync(Dictionary(_json_value.Content); @@ -168,7 +168,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin var _result = new Ticker(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -184,7 +184,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _ticker = publicClient.DeserializeObject(_json_value.Content); { @@ -213,7 +213,7 @@ public override async ValueTask FetchTickersAsync(Dictionary FetchTickersAsync(Dictionary>(_json_value.Content); { @@ -261,7 +261,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam var _result = new OrderBooks(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -286,7 +286,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orderbook = publicClient.DeserializeObject(_json_value.Content); { @@ -324,7 +324,7 @@ public override async ValueTask FetchOHLCVsAsync(string base_name, strin var _result = new OHLCVs(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -349,7 +349,7 @@ public override async ValueTask FetchOHLCVsAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject(_json_value.Content); @@ -395,7 +395,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string var _result = new CompleteOrders(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -421,7 +421,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject>(_json_value.Content); { diff --git a/src/exchanges/hk/binance/trade/trade.cs b/src/exchanges/hk/binance/trade/trade.cs index e1c6602..c421614 100644 --- a/src/exchanges/hk/binance/trade/trade.cs +++ b/src/exchanges/hk/binance/trade/trade.cs @@ -77,7 +77,7 @@ private bool sideValue { set { - sideType = (value == true) ? SideType.Bid : SideType.Ask; + sideType = (value) ? SideType.Bid : SideType.Ask; } } } diff --git a/src/exchanges/hk/binance/trade/tradeApi.cs b/src/exchanges/hk/binance/trade/tradeApi.cs index c6ad9e5..d07c36d 100644 --- a/src/exchanges/hk/binance/trade/tradeApi.cs +++ b/src/exchanges/hk/binance/trade/tradeApi.cs @@ -69,7 +69,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -86,7 +86,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -120,7 +120,7 @@ public override async ValueTask FetchMyOrdersAsync(string base_name, s var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -140,7 +140,7 @@ public override async ValueTask FetchMyOrdersAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); { @@ -181,7 +181,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -197,7 +197,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orders = tradeClient.DeserializeObject>(_json_value.Content); { @@ -229,7 +229,7 @@ public override async ValueTask FetchAllOpenOrdersAsync(Dictionary FetchAllOpenOrdersAsync(Dictionary>(_json_value.Content); { @@ -277,7 +277,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s var _result = new MyTrades(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -297,7 +297,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); { @@ -339,7 +339,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -362,7 +362,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -398,7 +398,7 @@ public override async ValueTask CreateMarketOrderAsync(string base_name var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -419,7 +419,7 @@ public override async ValueTask CreateMarketOrderAsync(string base_name _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -456,7 +456,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -473,7 +473,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { diff --git a/src/exchanges/jpn/anxpro/anxpro.cs b/src/exchanges/jpn/anxpro/anxpro.cs index 48623f5..1181c2d 100644 --- a/src/exchanges/jpn/anxpro/anxpro.cs +++ b/src/exchanges/jpn/anxpro/anxpro.cs @@ -145,7 +145,7 @@ public override async ValueTask CreatePostRequestAsync(string endpo { var _request = await base.CreatePostRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _nonce = GenerateOnlyNonce(16).ToString(); @@ -177,7 +177,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) if (response != null) { - if (response.IsSuccessful == true) + if (response.IsSuccessful) { var _json_result = this.DeserializeObject(response.Content); @@ -194,7 +194,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) } } - if (_result.success == true && response.IsSuccessful == false) + if (_result.success && response.IsSuccessful == false) { _result.SetFailure( response.ErrorMessage ?? response.StatusDescription, diff --git a/src/exchanges/jpn/anxpro/private/privateApi.cs b/src/exchanges/jpn/anxpro/private/privateApi.cs index 4e8c9d0..1045947 100644 --- a/src/exchanges/jpn/anxpro/private/privateApi.cs +++ b/src/exchanges/jpn/anxpro/private/privateApi.cs @@ -65,7 +65,7 @@ public override async ValueTask
FetchAddressAsync(string currency_name, var _result = new Address(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -76,7 +76,7 @@ public override async ValueTask
FetchAddressAsync(string currency_name, _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); { @@ -111,7 +111,7 @@ public override async ValueTask CoinWithdrawAsync(string currency_name var _result = new Transfer(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -130,10 +130,10 @@ public override async ValueTask CoinWithdrawAsync(string currency_name _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _withdraw = new ATransferItem { @@ -186,7 +186,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n var _result = new Transfers(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -206,10 +206,10 @@ public override async ValueTask FetchTransfersAsync(string currency_n _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _transfers = _json_data.data.result .Where(t => t.timestamp >= since) @@ -270,7 +270,7 @@ public override async ValueTask FetchBalanceAsync(string base_name, str var _result = new Balance(); var _currency_id = await publicApi.LoadCurrencyIdAsync(base_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -281,7 +281,7 @@ public override async ValueTask FetchBalanceAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); { @@ -326,7 +326,7 @@ public override async ValueTask FetchBalancesAsync(Dictionary FetchBalancesAsync(Dictionary(_json_value.Content); { diff --git a/src/exchanges/jpn/anxpro/public/publicApi.cs b/src/exchanges/jpn/anxpro/public/publicApi.cs index 15f4b78..7677ceb 100644 --- a/src/exchanges/jpn/anxpro/public/publicApi.cs +++ b/src/exchanges/jpn/anxpro/public/publicApi.cs @@ -97,7 +97,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin var _result = new Ticker(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -113,7 +113,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject(_json_value.Content); { @@ -144,7 +144,7 @@ public override async ValueTask FetchTickersAsync(Dictionary FetchTickersAsync(Dictionary(_json_value.Content); { @@ -204,7 +204,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam var _result = new OrderBooks(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -215,7 +215,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orderbook = publicClient.DeserializeObject(_json_value.Content); { diff --git a/src/exchanges/jpn/anxpro/trade/tradeApi.cs b/src/exchanges/jpn/anxpro/trade/tradeApi.cs index 6b20789..23a19f4 100644 --- a/src/exchanges/jpn/anxpro/trade/tradeApi.cs +++ b/src/exchanges/jpn/anxpro/trade/tradeApi.cs @@ -67,7 +67,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -78,10 +78,10 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { foreach (var _o in _json_data.result) { @@ -126,7 +126,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s var _result = new MyTrades(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -149,10 +149,10 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _trades = _json_data.result .Where(t => t.timestamp >= since) @@ -196,7 +196,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -216,10 +216,10 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _order = new AMyOrderItem { @@ -268,7 +268,7 @@ public override async ValueTask CreateMarketOrderAsync(string base_name var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -288,10 +288,10 @@ public override async ValueTask CreateMarketOrderAsync(string base_name _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _order = new AMyOrderItem { @@ -341,7 +341,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -357,10 +357,10 @@ public override async ValueTask CancelOrderAsync(string base_name, stri _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _order = new AMyOrderItem { diff --git a/src/exchanges/jpn/bitflyer/bitflyer.cs b/src/exchanges/jpn/bitflyer/bitflyer.cs index ea3a26e..8242eea 100644 --- a/src/exchanges/jpn/bitflyer/bitflyer.cs +++ b/src/exchanges/jpn/bitflyer/bitflyer.cs @@ -132,7 +132,7 @@ public override async ValueTask CreatePostRequestAsync(string endpo { var _request = await base.CreatePostRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _nonce = GenerateOnlyNonce(16).ToString(); @@ -163,7 +163,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) if (response != null) { - if (response.IsSuccessful == true) + if (response.IsSuccessful) { if (response.Content != "") { @@ -180,7 +180,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) } } - if (_result.success == true && response.IsSuccessful == false) + if (_result.success && response.IsSuccessful == false) { _result.SetFailure( response.ErrorMessage ?? response.StatusDescription, diff --git a/src/exchanges/jpn/bitflyer/private/privateApi.cs b/src/exchanges/jpn/bitflyer/private/privateApi.cs index 49b3c6f..c74510b 100644 --- a/src/exchanges/jpn/bitflyer/private/privateApi.cs +++ b/src/exchanges/jpn/bitflyer/private/privateApi.cs @@ -62,7 +62,7 @@ public override async ValueTask FetchAddressesAsync(Dictionary FetchAddressesAsync(Dictionary>(_json_value.Content); { @@ -113,7 +113,7 @@ public override async ValueTask FetchAllTransfersAsync(string timefra var _result = new Transfers(); var _markets = await publicApi.LoadMarketsAsync(); - if (_markets.success == true) + if (_markets.success) { var _timestamp = privateClient.ExchangeInfo.GetTimestamp(timeframe); var _timeframe = privateClient.ExchangeInfo.GetTimeframe(timeframe); @@ -140,7 +140,7 @@ public override async ValueTask FetchAllTransfersAsync(string timefra _result.rawJson += _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject>(_json_value.Content); { @@ -160,7 +160,7 @@ public override async ValueTask FetchAllTransfersAsync(string timefra } // TransactionType.Withdrawal - if (_result.success == true) + if (_result.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -169,7 +169,7 @@ public override async ValueTask FetchAllTransfersAsync(string timefra _result.rawJson += _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject>(_json_value.Content); { @@ -208,7 +208,7 @@ public override async ValueTask FetchBalanceAsync(string base_name, str var _result = new Balance(); var _currency_id = await publicApi.LoadCurrencyIdAsync(base_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -219,7 +219,7 @@ public override async ValueTask FetchBalanceAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _balances = privateClient.DeserializeObject>(_json_value.Content); { @@ -257,7 +257,7 @@ public override async ValueTask FetchBalancesAsync(Dictionary FetchBalancesAsync(Dictionary>(_json_value.Content); { diff --git a/src/exchanges/jpn/bitflyer/public/publicApi.cs b/src/exchanges/jpn/bitflyer/public/publicApi.cs index 2693621..bc16bc3 100644 --- a/src/exchanges/jpn/bitflyer/public/publicApi.cs +++ b/src/exchanges/jpn/bitflyer/public/publicApi.cs @@ -51,7 +51,7 @@ public override async ValueTask FetchMarketsAsync(Dictionary>(_json_value_jp.Content); @@ -63,7 +63,7 @@ public override async ValueTask FetchMarketsAsync(Dictionary>(_json_value_us.Content); _json_data_jp = _json_data_jp.Concat(_json_data_us).ToList(); @@ -73,7 +73,7 @@ public override async ValueTask FetchMarketsAsync(Dictionary>(_json_value_eu.Content); _json_data_jp = _json_data_jp.Concat(_json_data_eu).ToList(); @@ -166,7 +166,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin var _result = new Ticker(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -182,7 +182,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _ticker = publicClient.DeserializeObject(_json_value.Content); { @@ -215,7 +215,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam var _result = new OrderBooks(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -231,7 +231,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orderbook = publicClient.DeserializeObject(_json_value.Content); { @@ -269,7 +269,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string var _result = new CompleteOrders(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -289,7 +289,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject>(_json_value.Content); { diff --git a/src/exchanges/jpn/bitflyer/trade/tradeApi.cs b/src/exchanges/jpn/bitflyer/trade/tradeApi.cs index b84506e..fac87a3 100644 --- a/src/exchanges/jpn/bitflyer/trade/tradeApi.cs +++ b/src/exchanges/jpn/bitflyer/trade/tradeApi.cs @@ -68,7 +68,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -86,7 +86,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orders = tradeClient.DeserializeObject>(_json_value.Content); var _order = _orders.Where(o => o.orderId == order_id).SingleOrDefault(); @@ -121,7 +121,7 @@ public override async ValueTask FetchMyOrdersAsync(string base_name, s var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -140,7 +140,7 @@ public override async ValueTask FetchMyOrdersAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); { @@ -179,7 +179,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -196,7 +196,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orders = tradeClient.DeserializeObject>(_json_value.Content); { @@ -228,7 +228,7 @@ public override async ValueTask FetchAllOpenOrdersAsync(Dictionary FetchAllOpenOrdersAsync(Dictionary>(_json_value.Content); { @@ -276,7 +276,7 @@ public override async ValueTask FetchAllOpenPositionsAsync(Dictiona var _result = new MyPositions(); var _markets = await publicApi.LoadMarketsAsync(); - if (_markets.success == true) + if (_markets.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -287,7 +287,7 @@ public override async ValueTask FetchAllOpenPositionsAsync(Dictiona _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); { @@ -335,7 +335,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s var _result = new MyTrades(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -354,7 +354,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); { @@ -396,7 +396,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -419,7 +419,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -461,7 +461,7 @@ public override async ValueTask CreateMarketOrderAsync(string base_name var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -482,7 +482,7 @@ public override async ValueTask CreateMarketOrderAsync(string base_name _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -525,7 +525,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -543,7 +543,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = new BMyOrderItem { diff --git a/src/exchanges/jpn/coincheck/coincheck.cs b/src/exchanges/jpn/coincheck/coincheck.cs index f7b8bb6..bbeba06 100644 --- a/src/exchanges/jpn/coincheck/coincheck.cs +++ b/src/exchanges/jpn/coincheck/coincheck.cs @@ -131,7 +131,7 @@ public override async ValueTask CreatePostRequestAsync(string endpo { var _request = await base.CreatePostRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _nonce = GenerateOnlyNonce(10).ToString(); @@ -164,12 +164,12 @@ public override async ValueTask CreateGetRequestAsync(string endpoi { var _request = await base.CreateGetRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _nonce = GenerateOnlyNonce(10).ToString(); var _post_params = _request.Parameters.ToDictionary(p => p.Name, p => p.Value); - + var _post_data = ToQueryString(_post_params); if (_post_data.Length > 0) _post_data = "?" + _post_data; @@ -198,7 +198,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) if (response != null) { - if (response.IsSuccessful == true) + if (response.IsSuccessful) { var _json_result = this.DeserializeObject(response.Content); @@ -216,7 +216,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) } } - if (_result.success == true && response.IsSuccessful == false) + if (_result.success && response.IsSuccessful == false) { _result.SetFailure( response.ErrorMessage ?? response.StatusDescription, diff --git a/src/exchanges/jpn/coincheck/private/privateApi.cs b/src/exchanges/jpn/coincheck/private/privateApi.cs index 7919bbb..c8f9e85 100644 --- a/src/exchanges/jpn/coincheck/private/privateApi.cs +++ b/src/exchanges/jpn/coincheck/private/privateApi.cs @@ -65,7 +65,7 @@ public override async ValueTask
FetchAddressAsync(string currency_name, var _result = new Address(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -76,7 +76,7 @@ public override async ValueTask
FetchAddressAsync(string currency_name, _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _address = privateClient.DeserializeObject(_json_value.Content); { @@ -110,7 +110,7 @@ public override async ValueTask CoinWithdrawAsync(string currency_name var _result = new Transfer(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -127,7 +127,7 @@ public override async ValueTask CoinWithdrawAsync(string currency_name _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _withdraw = privateClient.DeserializeObject(_json_value.Content); { @@ -171,7 +171,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n var _result = new Transfers(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { var _timestamp = privateClient.ExchangeInfo.GetTimestamp(timeframe); var _timeframe = privateClient.ExchangeInfo.GetTimeframe(timeframe); @@ -192,10 +192,10 @@ public override async ValueTask FetchTransfersAsync(string currency_n _result.rawJson += _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _deposits = _json_data.result .Where(d => d.timestamp >= since) @@ -221,7 +221,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n } // TransactionType.Withdrawal - if (_result.success == true) + if (_result.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -230,10 +230,10 @@ public override async ValueTask FetchTransfersAsync(string currency_n _result.rawJson += _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _withdraws = _json_data.result .Where(w => w.timestamp >= since) @@ -276,7 +276,7 @@ public override async ValueTask FetchBalancesAsync(Dictionary FetchBalancesAsync(Dictionary(_json_value.Content); { @@ -296,7 +296,7 @@ public override async ValueTask FetchBalancesAsync(Dictionary() == true) + if (_json_data["success"].Value()) { if (_json_data.ContainsKey(_currency_id.Key)) _balance.free = _json_data[_currency_id.Key].Value(); diff --git a/src/exchanges/jpn/coincheck/public/publicApi.cs b/src/exchanges/jpn/coincheck/public/publicApi.cs index d03f81d..2d9db8a 100644 --- a/src/exchanges/jpn/coincheck/public/publicApi.cs +++ b/src/exchanges/jpn/coincheck/public/publicApi.cs @@ -108,7 +108,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin var _result = new Ticker(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -119,7 +119,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _ticker = publicClient.DeserializeObject(_json_value.Content); { @@ -152,7 +152,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam var _result = new OrderBooks(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -163,7 +163,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject(_json_value.Content); { @@ -218,7 +218,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string var _result = new CompleteOrders(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -238,7 +238,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject(_json_value.Content); { diff --git a/src/exchanges/jpn/coincheck/trade/tradeApi.cs b/src/exchanges/jpn/coincheck/trade/tradeApi.cs index 4cc5a72..2307a36 100644 --- a/src/exchanges/jpn/coincheck/trade/tradeApi.cs +++ b/src/exchanges/jpn/coincheck/trade/tradeApi.cs @@ -67,7 +67,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -78,7 +78,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orders = tradeClient.DeserializeObject(_json_value.Content); { @@ -112,7 +112,7 @@ public override async ValueTask FetchAllOpenPositionsAsync(Dictiona var _result = new MyPositions(); var _markets = await publicApi.LoadMarketsAsync(); - if (_markets.success == true) + if (_markets.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -123,7 +123,7 @@ public override async ValueTask FetchAllOpenPositionsAsync(Dictiona _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { @@ -163,7 +163,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s var _result = new MyTrades(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -177,7 +177,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { @@ -222,7 +222,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -243,7 +243,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -282,7 +282,7 @@ public override async ValueTask CreateMarketOrderAsync(string base_name var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -305,7 +305,7 @@ public override async ValueTask CreateMarketOrderAsync(string base_name _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -343,7 +343,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -354,7 +354,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { diff --git a/src/exchanges/jpn/quoinex/private/privateApi.cs b/src/exchanges/jpn/quoinex/private/privateApi.cs index fc45d69..c0bf634 100644 --- a/src/exchanges/jpn/quoinex/private/privateApi.cs +++ b/src/exchanges/jpn/quoinex/private/privateApi.cs @@ -62,7 +62,7 @@ public override async ValueTask FetchAddressesAsync(Dictionary FetchAddressesAsync(Dictionary>(_json_value.Content); { @@ -111,7 +111,7 @@ public override async ValueTask FetchBalanceAsync(string base_name, str var _result = new Balance(); var _currency_id = await publicApi.LoadCurrencyIdAsync(base_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -122,7 +122,7 @@ public override async ValueTask FetchBalanceAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _balances = privateClient.DeserializeObject>(_json_value.Content); { @@ -160,7 +160,7 @@ public override async ValueTask FetchBalancesAsync(Dictionary FetchBalancesAsync(Dictionary>(_json_value.Content); { diff --git a/src/exchanges/jpn/quoinex/public/publicApi.cs b/src/exchanges/jpn/quoinex/public/publicApi.cs index 526c99b..b372b86 100644 --- a/src/exchanges/jpn/quoinex/public/publicApi.cs +++ b/src/exchanges/jpn/quoinex/public/publicApi.cs @@ -54,7 +54,7 @@ public override async ValueTask FetchMarketsAsync(Dictionary>(_json_value.Content); foreach (var _market in _products) @@ -164,7 +164,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin var _result = new Ticker(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -175,7 +175,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _ticker = publicClient.DeserializeObject(_json_value.Content); { @@ -206,7 +206,7 @@ public override async ValueTask FetchTickersAsync(Dictionary FetchTickersAsync(Dictionary>(_json_value.Content); { @@ -254,7 +254,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam var _result = new OrderBooks(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -271,7 +271,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orderbook = publicClient.DeserializeObject(_json_value.Content); { @@ -309,7 +309,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string var _result = new CompleteOrders(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -333,7 +333,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject(_json_value.Content); { diff --git a/src/exchanges/jpn/quoinex/quoinex.cs b/src/exchanges/jpn/quoinex/quoinex.cs index 7a5589c..0c721b5 100644 --- a/src/exchanges/jpn/quoinex/quoinex.cs +++ b/src/exchanges/jpn/quoinex/quoinex.cs @@ -162,7 +162,7 @@ public override async ValueTask CreateGetRequestAsync(string endpoi { var _request = await base.CreateGetRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _nonce = GenerateOnlyNonce(13); @@ -201,7 +201,7 @@ public override async ValueTask CreatePutRequestAsync(string endpoi { var _request = await base.CreatePutRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _nonce = GenerateOnlyNonce(13); @@ -269,7 +269,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) if (String.IsNullOrEmpty(_error_msg) == false) { - if (ErrorMessages.ContainsKey(_error_msg) == true) + if (ErrorMessages.ContainsKey(_error_msg)) _error_code = ErrorMessages[_error_msg]; _result.SetFailure(_error_msg, _error_code); @@ -277,7 +277,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) } } - if (_result.success == true && response.IsSuccessful == false) + if (_result.success && response.IsSuccessful == false) { _result.SetFailure( response.ErrorMessage ?? response.StatusDescription, diff --git a/src/exchanges/jpn/quoinex/trade/tradeApi.cs b/src/exchanges/jpn/quoinex/trade/tradeApi.cs index ed229a7..18703f8 100644 --- a/src/exchanges/jpn/quoinex/trade/tradeApi.cs +++ b/src/exchanges/jpn/quoinex/trade/tradeApi.cs @@ -67,7 +67,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -78,7 +78,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -112,7 +112,7 @@ public override async ValueTask FetchMyOrdersAsync(string base_name, s var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -131,7 +131,7 @@ public override async ValueTask FetchMyOrdersAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { @@ -170,7 +170,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -187,7 +187,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { @@ -223,7 +223,7 @@ public override async ValueTask FetchAllOpenOrdersAsync(Dictionary FetchAllOpenOrdersAsync(Dictionary(_json_value.Content); { @@ -279,7 +279,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s var _result = new MyTrades(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -298,7 +298,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { @@ -340,7 +340,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -362,7 +362,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -400,7 +400,7 @@ public override async ValueTask CreateMarketOrderAsync(string base_name var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -421,7 +421,7 @@ public override async ValueTask CreateMarketOrderAsync(string base_name _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -460,7 +460,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -471,9 +471,9 @@ public override async ValueTask CancelOrderAsync(string base_name, stri _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { diff --git a/src/exchanges/kor/bithumb/bithumb.cs b/src/exchanges/kor/bithumb/bithumb.cs index 8a9a632..cf506c1 100644 --- a/src/exchanges/kor/bithumb/bithumb.cs +++ b/src/exchanges/kor/bithumb/bithumb.cs @@ -145,7 +145,7 @@ public override async ValueTask CreatePostRequestAsync(string endpo { var _request = await base.CreatePostRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _params = new Dictionary(); { @@ -201,7 +201,7 @@ public override async ValueTask CreatePostRequestAsync(string endpo /// public override string GetErrorMessage(int error_code) { - return ErrorMessages.ContainsKey(error_code) == true + return ErrorMessages.ContainsKey(error_code) ? ErrorMessages[error_code] : "failure"; } @@ -242,7 +242,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) } } - if (_result.success == true && response.IsSuccessful == false) + if (_result.success && response.IsSuccessful == false) { _result.SetFailure( response.ErrorMessage ?? response.StatusDescription, diff --git a/src/exchanges/kor/bithumb/private/privateApi.cs b/src/exchanges/kor/bithumb/private/privateApi.cs index 0c2d996..f0d7621 100644 --- a/src/exchanges/kor/bithumb/private/privateApi.cs +++ b/src/exchanges/kor/bithumb/private/privateApi.cs @@ -65,7 +65,7 @@ public override async ValueTask
FetchAddressAsync(string currency_name, var _result = new Address(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -81,10 +81,10 @@ public override async ValueTask
FetchAddressAsync(string currency_name, _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) _result.result = _json_data.result; else _json_result.SetResult(_json_data); @@ -114,7 +114,7 @@ public override async ValueTask CoinWithdrawAsync(string currency_name var _result = new Transfer(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -132,10 +132,10 @@ public override async ValueTask CoinWithdrawAsync(string currency_name _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _withdraw = new BTransferItem { @@ -188,7 +188,7 @@ public override async ValueTask FiatWithdrawAsync(string currency_name var _result = new Transfer(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -206,10 +206,10 @@ public override async ValueTask FiatWithdrawAsync(string currency_name _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _withdraw = new BTransferItem { @@ -262,7 +262,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n var _result = new Transfers(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -284,10 +284,10 @@ public override async ValueTask FetchTransfersAsync(string currency_n _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _transfers = _json_data.result .Where(t => t.timestamp >= since && (t.transactionType == TransactionType.Deposit || t.transactionType == TransactionType.Withdraw)) @@ -338,7 +338,7 @@ public override async ValueTask FetchWalletAsync(string base_name, strin var _result = new Wallet(); var _currency_id = await publicApi.LoadCurrencyIdAsync(base_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -354,10 +354,10 @@ public override async ValueTask FetchWalletAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _balance = _json_data.result.balance; { @@ -395,7 +395,7 @@ public override async ValueTask FetchBalanceAsync(string base_name, str var _result = new Balance(); var _currency_id = await publicApi.LoadCurrencyIdAsync(base_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -411,10 +411,10 @@ public override async ValueTask FetchBalanceAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _base_id = _currency_id.result; @@ -461,7 +461,7 @@ public override async ValueTask FetchBalancesAsync(Dictionary FetchBalancesAsync(Dictionary(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { foreach (var _coin_id in _markets.CurrencyNames) { diff --git a/src/exchanges/kor/bithumb/public/publicApi.cs b/src/exchanges/kor/bithumb/public/publicApi.cs index d242889..5901e8a 100644 --- a/src/exchanges/kor/bithumb/public/publicApi.cs +++ b/src/exchanges/kor/bithumb/public/publicApi.cs @@ -70,7 +70,7 @@ public override async ValueTask FetchMarketsAsync(Dictionary(_json_value.Content); @@ -85,7 +85,7 @@ public override async ValueTask FetchMarketsAsync(Dictionary FetchTickerAsync(string base_name, strin var _result = new Ticker(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -168,10 +168,10 @@ public override async ValueTask FetchTickerAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { _result.SetResult(_json_data); { @@ -210,7 +210,7 @@ public override async ValueTask FetchTickersAsync(Dictionary FetchTickersAsync(Dictionary(_json_value.Content); if (_json_data.statusCode == 0) @@ -275,7 +275,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam var _result = new OrderBooks(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -296,10 +296,10 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { _result.result.asks = _json_data.result.asks.OrderBy(o => o.price).Take(limits).ToList(); _result.result.bids = _json_data.result.bids.OrderByDescending(o => o.price).Take(limits).ToList(); @@ -343,7 +343,7 @@ public override async ValueTask FetchOHLCVsAsync(string base_name, strin var _result = new OHLCVs(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -371,7 +371,7 @@ public override async ValueTask FetchOHLCVsAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject(_json_value.Content); { @@ -418,7 +418,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string var _result = new CompleteOrders(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -442,10 +442,10 @@ public override async ValueTask FetchCompleteOrdersAsync(string _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _orders = _json_data.result .Where(t => t.timestamp >= since) diff --git a/src/exchanges/kor/bithumb/trade/tradeApi.cs b/src/exchanges/kor/bithumb/trade/tradeApi.cs index 3fe27ca..9c2917d 100644 --- a/src/exchanges/kor/bithumb/trade/tradeApi.cs +++ b/src/exchanges/kor/bithumb/trade/tradeApi.cs @@ -67,7 +67,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -85,12 +85,12 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { - var _type = (_params.ContainsKey("type") == true) ? _params["type"].ToString() : ""; + var _type = (_params.ContainsKey("type")) ? _params["type"].ToString() : ""; var _order = new BMyOrderItem { @@ -109,7 +109,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str foreach (var _o in _json_data.result) { - //if (String.IsNullOrEmpty(_order.contract_id) == true) + //if (String.IsNullOrEmpty(_order.contract_id)) // _order.contract_id = _o.contract_id; if (_order.sideType != _o.sideType) @@ -160,7 +160,7 @@ public override async ValueTask FetchMyOrdersAsync(string base_name, s var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -183,12 +183,12 @@ public override async ValueTask FetchMyOrdersAsync(string base_name, s _result.rawJson += _json_value_detail.Content; #endif var _json_result_detail = tradeClient.GetResponseMessage(_json_value_detail.Response); - if (_json_result_detail.success == true) + if (_json_result_detail.success) { var _json_data_detail = tradeClient.DeserializeObject(_json_value_detail.Content); - if (_json_data_detail.success == true) + if (_json_data_detail.success) { - //var _order_id = (_params.ContainsKey("order_id") == true) ? _params["order_id"].ToString() : ""; + //var _order_id = (_params.ContainsKey("order_id")) ? _params["order_id"].ToString() : ""; foreach (var _o in _json_data_detail.result) { @@ -216,15 +216,15 @@ public override async ValueTask FetchMyOrdersAsync(string base_name, s _result.rawJson += _json_value_orders.Content; #endif var _json_result_orders = tradeClient.GetResponseMessage(_json_value_orders.Response); - if (_json_result_orders.success == true) + if (_json_result_orders.success) { var _json_data_orders = tradeClient.DeserializeObject(_json_value_orders.Content); - if (_json_data_orders.success == true) + if (_json_data_orders.success) { foreach (var _o in _json_data_orders.result) { #if DEBUG - if (String.IsNullOrEmpty(_o.orderId) == true) + if (String.IsNullOrEmpty(_o.orderId)) continue; #endif @@ -272,7 +272,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -293,10 +293,10 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { foreach (var _o in _json_data.result) { @@ -345,7 +345,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s var _result = new MyTrades(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -367,10 +367,10 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _orders = _json_data.result .Where(o => o.timestamp >= since && (o.sideType == SideType.Ask || o.sideType == SideType.Bid)) @@ -419,7 +419,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -441,10 +441,10 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _limit_order = new BPlaceOrderItem { @@ -502,7 +502,7 @@ public override async ValueTask CreateMarketOrderAsync(string base_name var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -521,10 +521,10 @@ public override async ValueTask CreateMarketOrderAsync(string base_name _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _market_order = new BPlaceOrderItem { @@ -583,7 +583,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -603,10 +603,10 @@ public override async ValueTask CancelOrderAsync(string base_name, stri _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _cancel_order = new BPlaceOrderItem { diff --git a/src/exchanges/kor/coinone/coinone.cs b/src/exchanges/kor/coinone/coinone.cs index b451abd..df7abc2 100644 --- a/src/exchanges/kor/coinone/coinone.cs +++ b/src/exchanges/kor/coinone/coinone.cs @@ -138,7 +138,7 @@ public override async ValueTask CreatePostRequestAsync(string endpo { var _request = await base.CreatePostRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _params = new Dictionary(); { @@ -235,7 +235,7 @@ public override async ValueTask CreatePostRequestAsync(string endpo /// public override string GetErrorMessage(int error_code) { - return ErrorMessages.ContainsKey(error_code) == true + return ErrorMessages.ContainsKey(error_code) ? ErrorMessages[error_code] : "failure"; } @@ -251,7 +251,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) if (response != null) { - if (response.IsSuccessful == true) + if (response.IsSuccessful) { if (response.Content.Length > 0 && response.Content[0] == '{') { @@ -277,7 +277,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) } } - if (_result.success == true && response.IsSuccessful == false) + if (_result.success && response.IsSuccessful == false) { _result.SetFailure( response.ErrorMessage ?? response.StatusDescription, diff --git a/src/exchanges/kor/coinone/private/privateApi.cs b/src/exchanges/kor/coinone/private/privateApi.cs index df99354..9c32da3 100644 --- a/src/exchanges/kor/coinone/private/privateApi.cs +++ b/src/exchanges/kor/coinone/private/privateApi.cs @@ -69,7 +69,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n var _result = new Transfers(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -88,7 +88,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); @@ -134,7 +134,7 @@ public override async ValueTask FetchAddressesAsync(Dictionary FetchAddressesAsync(Dictionary(_json_value.Content); { @@ -153,7 +153,7 @@ public override async ValueTask FetchAddressesAsync(Dictionary CoinWithdrawAsync(string currency_name var _result = new Transfer(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -219,10 +219,10 @@ public override async ValueTask CoinWithdrawAsync(string currency_name _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _withdraw = new CTransferItem { @@ -273,7 +273,7 @@ public override async ValueTask FetchBalanceAsync(string base_name, str var _result = new Balance(); var _currency_id = await publicApi.LoadCurrencyIdAsync(base_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -284,7 +284,7 @@ public override async ValueTask FetchBalanceAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _balances = privateClient.DeserializeObject>(_json_value.Content); { @@ -328,7 +328,7 @@ public override async ValueTask FetchBalancesAsync(Dictionary FetchBalancesAsync(Dictionary>(_json_value.Content); { @@ -381,7 +381,7 @@ public async Task GetAuthNumberAsync(string currency_name, Dictiona var _result = new CAuthNumber(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -395,7 +395,7 @@ public async Task GetAuthNumberAsync(string currency_name, Dictiona var _json_value = await privateClient.CallApiPost1Async("/v2/transaction/auth_number/", _params); var _json_result = privateClient.GetResponseMessage(_json_value.Response); - //if (_json_result.success == true) + //if (_json_result.success) { // auth number를 넘겨 받아야 하지만 현재는 핸폰 SMS로 전달 되고 있음 var _auth_number = privateClient.GenerateNonceString(16, 6); diff --git a/src/exchanges/kor/coinone/public/publicApi.cs b/src/exchanges/kor/coinone/public/publicApi.cs index 02908d3..74cbf37 100644 --- a/src/exchanges/kor/coinone/public/publicApi.cs +++ b/src/exchanges/kor/coinone/public/publicApi.cs @@ -58,7 +58,7 @@ public override async ValueTask FetchMarketsAsync(Dictionary>(_json_value.Content); foreach (var _market in _tickers) @@ -71,7 +71,7 @@ public override async ValueTask FetchMarketsAsync(Dictionary FetchTickerAsync(string base_name, strin var _result = new Ticker(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -160,7 +160,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _ticker = publicClient.DeserializeObject(_json_value.Content); { @@ -190,7 +190,7 @@ public override async ValueTask FetchTickersAsync(Dictionary FetchTickersAsync(Dictionary>(_json_value.Content); { @@ -250,7 +250,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam var _result = new OrderBooks(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -266,7 +266,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orderbook = publicClient.DeserializeObject(_json_value.Content); { @@ -304,7 +304,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string var _result = new CompleteOrders(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -324,10 +324,10 @@ public override async ValueTask FetchCompleteOrdersAsync(string _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _orders = _json_data.result .Where(t => t.timestamp >= since) diff --git a/src/exchanges/kor/coinone/trade/tradeApi.cs b/src/exchanges/kor/coinone/trade/tradeApi.cs index 2c9e175..bc08252 100644 --- a/src/exchanges/kor/coinone/trade/tradeApi.cs +++ b/src/exchanges/kor/coinone/trade/tradeApi.cs @@ -66,7 +66,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -83,7 +83,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -118,7 +118,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -134,10 +134,10 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orders = tradeClient.DeserializeObject(_json_value.Content); - if (_orders.success == true) + if (_orders.success) { foreach (var _order in _orders.limitOrders) { @@ -178,7 +178,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s var _result = new MyTrades(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -197,7 +197,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { @@ -240,7 +240,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -260,10 +260,10 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _order = new CPlaceOrderItem { @@ -317,7 +317,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -337,7 +337,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { //var _json_data = tradeClient.DeserializeObject(_json_value.Content); { diff --git a/src/exchanges/kor/gopax/gopax.cs b/src/exchanges/kor/gopax/gopax.cs index bb2a8b5..d48b119 100644 --- a/src/exchanges/kor/gopax/gopax.cs +++ b/src/exchanges/kor/gopax/gopax.cs @@ -144,7 +144,7 @@ public override async ValueTask CreateGetRequestAsync(string endpoi { var _request = await base.CreateGetRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _nonce = GenerateOnlyNonce(13).ToString(); @@ -172,7 +172,7 @@ public override async ValueTask CreatePostRequestAsync(string endpo { var _request = await base.CreatePostRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _nonce = GenerateOnlyNonce(13).ToString(); @@ -200,7 +200,7 @@ public override async ValueTask CreateDeleteRequestAsync(string end { var _request = await base.CreateDeleteRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _nonce = GenerateOnlyNonce(13).ToString(); @@ -243,7 +243,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) } } - if (_result.success == true && response.IsSuccessful == false) + if (_result.success && response.IsSuccessful == false) { _result.SetFailure( response.ErrorMessage ?? response.StatusDescription, diff --git a/src/exchanges/kor/gopax/private/privateApi.cs b/src/exchanges/kor/gopax/private/privateApi.cs index cbff9c2..eac7b88 100644 --- a/src/exchanges/kor/gopax/private/privateApi.cs +++ b/src/exchanges/kor/gopax/private/privateApi.cs @@ -64,7 +64,7 @@ public override async ValueTask FetchBalanceAsync(string base_name, str var _result = new Balance(); var _currency_id = await publicApi.LoadCurrencyIdAsync(base_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -75,7 +75,7 @@ public override async ValueTask FetchBalanceAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _balance = privateClient.DeserializeObject(_json_value.Content); { @@ -106,7 +106,7 @@ public override async ValueTask FetchBalancesAsync(Dictionary FetchBalancesAsync(Dictionary>(_json_value.Content); { diff --git a/src/exchanges/kor/gopax/public/publicApi.cs b/src/exchanges/kor/gopax/public/publicApi.cs index a0a0f10..16affbc 100644 --- a/src/exchanges/kor/gopax/public/publicApi.cs +++ b/src/exchanges/kor/gopax/public/publicApi.cs @@ -54,7 +54,7 @@ public override async ValueTask FetchMarketsAsync(Dictionary>(_json_value.Content); foreach (var _market in _pairs) @@ -137,7 +137,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin var _result = new Ticker(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -148,7 +148,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _ticker = publicClient.DeserializeObject(_json_value.Content); { @@ -177,7 +177,7 @@ public override async ValueTask FetchTickersAsync(Dictionary FetchTickersAsync(Dictionary>(_json_value.Content); { @@ -222,7 +222,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam var _result = new OrderBooks(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -241,7 +241,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orderbook = publicClient.DeserializeObject(_json_value.Content); { @@ -279,7 +279,7 @@ public override async ValueTask FetchOHLCVsAsync(string base_name, strin var _result = new OHLCVs(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -304,7 +304,7 @@ public override async ValueTask FetchOHLCVsAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject>(_json_value.Content); @@ -350,7 +350,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string var _result = new CompleteOrders(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -371,7 +371,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject>(_json_value.Content); { diff --git a/src/exchanges/kor/gopax/trade/tradeApi.cs b/src/exchanges/kor/gopax/trade/tradeApi.cs index 8c02ef7..a918f2e 100644 --- a/src/exchanges/kor/gopax/trade/tradeApi.cs +++ b/src/exchanges/kor/gopax/trade/tradeApi.cs @@ -68,7 +68,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -79,7 +79,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -113,7 +113,7 @@ public override async ValueTask FetchMyOrdersAsync(string base_name, s var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -132,7 +132,7 @@ public override async ValueTask FetchMyOrdersAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); { @@ -174,7 +174,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s var _result = new MyTrades(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -193,7 +193,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); { @@ -235,7 +235,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -257,7 +257,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -295,7 +295,7 @@ public override async ValueTask CreateMarketOrderAsync(string base_name var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -316,7 +316,7 @@ public override async ValueTask CreateMarketOrderAsync(string base_name _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -355,7 +355,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -366,7 +366,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { //var _json_data = tradeClient.DeserializeObject(_json_value.Content); { diff --git a/src/exchanges/kor/korbit/korbit.cs b/src/exchanges/kor/korbit/korbit.cs index 39adc78..b08d362 100644 --- a/src/exchanges/kor/korbit/korbit.cs +++ b/src/exchanges/kor/korbit/korbit.cs @@ -118,9 +118,9 @@ public override ExchangeInfo ExchangeInfo /// public async Task GetAccessToken() { - if (__access_token.success == true) + if (__access_token.success) { - if (__access_token.CheckExpired() == true) + if (__access_token.CheckExpired()) __access_token = await GetAccessToken("refresh_token", __access_token.refreshToken); } @@ -161,7 +161,7 @@ public async Task GetAccessToken(string grant_type, string refresh_ var _request = await base.CreatePostRequestAsync("/oauth2/access_token", _params); { var _access_token = await base.RestExecuteAsync(_request); - if (_access_token.IsSuccessful == true) + if (_access_token.IsSuccessful) { _result = this.DeserializeObject(_access_token.Content); _result.SetSuccess(); @@ -187,7 +187,7 @@ public override async ValueTask CreatePostRequestAsync(string endpo { var _request = await base.CreatePostRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { #if DEBUG if (TestXUnitMode == XUnitMode.UseExchangeServer) @@ -218,7 +218,7 @@ public override async ValueTask CreateGetRequestAsync(string endpoi { var _request = await base.CreateGetRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { #if DEBUG if (TestXUnitMode == XUnitMode.UseExchangeServer) @@ -246,7 +246,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) if (response != null) { - if (response.IsSuccessful == true) + if (response.IsSuccessful) { if (String.IsNullOrEmpty(response.Content) == false && response.Content != "[]") { @@ -271,7 +271,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) } } - if (_result.success == true && response.IsSuccessful == false) + if (_result.success && response.IsSuccessful == false) { var _message = response.ErrorMessage ?? response.StatusDescription; diff --git a/src/exchanges/kor/korbit/private/privateApi.cs b/src/exchanges/kor/korbit/private/privateApi.cs index d1336b5..08ccbe9 100644 --- a/src/exchanges/kor/korbit/private/privateApi.cs +++ b/src/exchanges/kor/korbit/private/privateApi.cs @@ -71,7 +71,7 @@ public override async ValueTask
CreateAddressAsync(string currency_name var _result = new Address(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -87,7 +87,7 @@ public override async ValueTask
CreateAddressAsync(string currency_name _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); { @@ -116,7 +116,7 @@ public override async ValueTask FetchAddressesAsync(Dictionary FetchAddressesAsync(Dictionary(_json_value.Content); { @@ -177,7 +177,7 @@ public override async ValueTask CoinWithdrawAsync(string currency_name var _result = new Transfer(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -195,10 +195,10 @@ public override async ValueTask CoinWithdrawAsync(string currency_name _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _withdraw = new KTransferItem { @@ -250,7 +250,7 @@ public override async ValueTask CancelCoinWithdrawAsync(string currenc var _result = new Transfer(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -267,10 +267,10 @@ public override async ValueTask CancelCoinWithdrawAsync(string currenc _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _withdraw = new KTransferItem { @@ -317,7 +317,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n var _result = new Transfers(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -339,7 +339,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject>(_json_value.Content); { @@ -350,7 +350,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n foreach (var _t in _transfers) { - if (String.IsNullOrEmpty(_t.transactionId) == true) + if (String.IsNullOrEmpty(_t.transactionId)) continue; //_t.transferId = _t.timestamp.ToString(); // transferId 있음 @@ -381,7 +381,7 @@ public override async ValueTask FetchBalancesAsync(Dictionary FetchBalancesAsync(Dictionary>(_json_value.Content); diff --git a/src/exchanges/kor/korbit/public/publicApi.cs b/src/exchanges/kor/korbit/public/publicApi.cs index a3257a9..718fddc 100644 --- a/src/exchanges/kor/korbit/public/publicApi.cs +++ b/src/exchanges/kor/korbit/public/publicApi.cs @@ -52,7 +52,7 @@ public override async ValueTask FetchMarketsAsync(Dictionary(_json_value.Content); @@ -139,7 +139,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin var _result = new Ticker(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -155,7 +155,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _ticker = publicClient.DeserializeObject(_json_value.Content); { @@ -187,7 +187,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam var _result = new OrderBooks(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -204,7 +204,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orderbook = publicClient.DeserializeObject(_json_value.Content); { @@ -242,7 +242,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string var _result = new CompleteOrders(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -263,7 +263,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject>(_json_value.Content); { diff --git a/src/exchanges/kor/korbit/trade/tradeApi.cs b/src/exchanges/kor/korbit/trade/tradeApi.cs index aff6697..97502e8 100644 --- a/src/exchanges/kor/korbit/trade/tradeApi.cs +++ b/src/exchanges/kor/korbit/trade/tradeApi.cs @@ -70,7 +70,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -89,7 +89,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orders = tradeClient.DeserializeObject>(_json_value.Content); { @@ -126,7 +126,7 @@ public override async ValueTask FetchMyOrdersAsync(string base_name, s var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -147,7 +147,7 @@ public override async ValueTask FetchMyOrdersAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); { @@ -189,7 +189,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -207,7 +207,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orders = tradeClient.DeserializeObject>(_json_value.Content); { @@ -253,7 +253,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s var _result = new MyTrades(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -275,7 +275,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); { @@ -320,7 +320,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -341,10 +341,10 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _order = new KPlaceOrderItem { @@ -398,7 +398,7 @@ public override async ValueTask CreateMarketOrderAsync(string base_name var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -422,10 +422,10 @@ public override async ValueTask CreateMarketOrderAsync(string base_name _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _order = new KPlaceOrderItem { @@ -480,7 +480,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -497,7 +497,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); { @@ -555,7 +555,7 @@ public override async ValueTask CancelOrdersAsync(string base_name, st var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -572,7 +572,7 @@ public override async ValueTask CancelOrdersAsync(string base_name, st _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); { diff --git a/src/exchanges/kor/okcoinkr/okcoinkr.cs b/src/exchanges/kor/okcoinkr/okcoinkr.cs index 8b1e84e..3c19548 100644 --- a/src/exchanges/kor/okcoinkr/okcoinkr.cs +++ b/src/exchanges/kor/okcoinkr/okcoinkr.cs @@ -149,7 +149,7 @@ public override async ValueTask CreatePostRequestAsync(string endpo { var _request = await base.CreatePostRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _params = new Dictionary(); { @@ -199,7 +199,7 @@ public override async ValueTask CreatePostRequestAsync(string endpo /// public override string GetErrorMessage(int error_code) { - return ErrorMessages.ContainsKey(error_code) == true + return ErrorMessages.ContainsKey(error_code) ? ErrorMessages[error_code] : "failure"; } @@ -215,7 +215,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) if (response != null) { - if (response.IsSuccessful == true) + if (response.IsSuccessful) { var _json_result = this.DeserializeObject(response.Content); @@ -234,7 +234,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) } } - if (_result.success == true && response.IsSuccessful == false) + if (_result.success && response.IsSuccessful == false) { _result.SetFailure( response.ErrorMessage ?? response.StatusDescription, diff --git a/src/exchanges/kor/okcoinkr/private/balance.cs b/src/exchanges/kor/okcoinkr/private/balance.cs index 89bdf23..49936e9 100644 --- a/src/exchanges/kor/okcoinkr/private/balance.cs +++ b/src/exchanges/kor/okcoinkr/private/balance.cs @@ -26,7 +26,7 @@ private bool resultValue set { success = value; - message = success == true ? "success" : "failure"; + message = success ? "success" : "failure"; } } diff --git a/src/exchanges/kor/okcoinkr/private/privateApi.cs b/src/exchanges/kor/okcoinkr/private/privateApi.cs index 4fb3628..8d8bf25 100644 --- a/src/exchanges/kor/okcoinkr/private/privateApi.cs +++ b/src/exchanges/kor/okcoinkr/private/privateApi.cs @@ -62,7 +62,7 @@ public override async ValueTask FetchBalancesAsync(Dictionary FetchBalancesAsync(Dictionary(_json_value.Content); { diff --git a/src/exchanges/kor/okcoinkr/public/publicApi.cs b/src/exchanges/kor/okcoinkr/public/publicApi.cs index 7d7adc5..984aca3 100644 --- a/src/exchanges/kor/okcoinkr/public/publicApi.cs +++ b/src/exchanges/kor/okcoinkr/public/publicApi.cs @@ -70,7 +70,7 @@ public override async ValueTask FetchMarketsAsync(Dictionary(_json_value.Content); foreach (var _m in _markets.result) @@ -145,7 +145,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin var _result = new Ticker(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -161,7 +161,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject(_json_value.Content); { @@ -200,7 +200,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam var _result = new OrderBooks(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -217,7 +217,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orderbook = publicClient.DeserializeObject(_json_value.Content); { @@ -257,7 +257,7 @@ public override async ValueTask FetchOHLCVsAsync(string base_name, strin var _result = new OHLCVs(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -280,7 +280,7 @@ public override async ValueTask FetchOHLCVsAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject>(_json_value.Content); @@ -326,7 +326,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string var _result = new CompleteOrders(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -347,7 +347,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject>(_json_value.Content); { diff --git a/src/exchanges/kor/okcoinkr/trade/order.cs b/src/exchanges/kor/okcoinkr/trade/order.cs index eff8338..b126d4d 100644 --- a/src/exchanges/kor/okcoinkr/trade/order.cs +++ b/src/exchanges/kor/okcoinkr/trade/order.cs @@ -27,7 +27,7 @@ private bool resultValue set { success = value; - message = success == true ? "success" : "failure"; + message = success ? "success" : "failure"; } } diff --git a/src/exchanges/kor/okcoinkr/trade/place.cs b/src/exchanges/kor/okcoinkr/trade/place.cs index 61d3aa0..d0d7a95 100644 --- a/src/exchanges/kor/okcoinkr/trade/place.cs +++ b/src/exchanges/kor/okcoinkr/trade/place.cs @@ -101,7 +101,7 @@ private bool resultValue { success = value; result.success = success; - message = success == true ? "success" : "failure"; + message = success ? "success" : "failure"; } } diff --git a/src/exchanges/kor/okcoinkr/trade/tradeApi.cs b/src/exchanges/kor/okcoinkr/trade/tradeApi.cs index f7f4474..dcd9eed 100644 --- a/src/exchanges/kor/okcoinkr/trade/tradeApi.cs +++ b/src/exchanges/kor/okcoinkr/trade/tradeApi.cs @@ -67,7 +67,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -84,10 +84,10 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _order = _json_data.result.FirstOrDefault(); @@ -129,7 +129,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -148,10 +148,10 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { foreach (var _o in _json_data.result) { @@ -190,7 +190,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s var _result = new MyTrades(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -212,7 +212,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); { @@ -254,7 +254,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -275,7 +275,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { @@ -322,7 +322,7 @@ public override async ValueTask CreateMarketOrderAsync(string base_name var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -345,7 +345,7 @@ public override async ValueTask CreateMarketOrderAsync(string base_name _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { @@ -393,7 +393,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -410,12 +410,12 @@ public override async ValueTask CancelOrderAsync(string base_name, stri _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); var _cancel = _json_data.result.FirstOrDefault(); - if (_cancel != null && _cancel.success == true) + if (_cancel != null && _cancel.success) { var _order = new OPlaceOrderItem { @@ -463,7 +463,7 @@ public override async ValueTask CancelOrdersAsync(string base_name, st var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -480,7 +480,7 @@ public override async ValueTask CancelOrdersAsync(string base_name, st _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); foreach (var _o in _json_data.result) diff --git a/src/exchanges/kor/upbit/private/privateApi.cs b/src/exchanges/kor/upbit/private/privateApi.cs index b580c96..5abe752 100644 --- a/src/exchanges/kor/upbit/private/privateApi.cs +++ b/src/exchanges/kor/upbit/private/privateApi.cs @@ -67,7 +67,7 @@ public override async ValueTask CoinWithdrawAsync(string currency_name var _result = new Transfer(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -87,7 +87,7 @@ public override async ValueTask CoinWithdrawAsync(string currency_name _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); { @@ -131,23 +131,23 @@ public override async ValueTask CoinWithdrawAsync(string currency_name /// 화폐 출금 /// /// base coin or quote coin name - /// coin address for send - /// Secondary address identifier for coins like XRP,XMR etc. - /// amount of coin + /// coin address for send + /// Secondary address identifier for coins like XRP,XMR etc. + /// amount of coin /// Add additional attributes for each exchange /// - public override async ValueTask FiatWithdrawAsync(string currency_name, string address, string tag, decimal quantity, Dictionary args = null) + public override async ValueTask FiatWithdrawAsync(string currency_name, string bank_name, string account, decimal amount, Dictionary args = null) { var _result = new Transfer(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); var _params = new Dictionary(); { - _params.Add("amount", quantity); + _params.Add("amount", amount); privateClient.MergeParamsAndArgs(_params, args); } @@ -157,7 +157,7 @@ public override async ValueTask FiatWithdrawAsync(string currency_name _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); { @@ -170,8 +170,8 @@ public override async ValueTask FiatWithdrawAsync(string currency_name transactionType = _json_data.transactionType, currency = _json_data.currency, - toAddress = address, - toTag = tag, + toAddress = bank_name, + toTag = account, amount = _json_data.amount, fee = _json_data.fee, @@ -209,7 +209,7 @@ public override async ValueTask FetchTransferAsync(string currency_nam var _result = new Transfer(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -225,7 +225,7 @@ public override async ValueTask FetchTransferAsync(string currency_nam _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); { @@ -257,7 +257,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n var _result = new Transfers(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -277,7 +277,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject>(_json_value.Content); { @@ -316,7 +316,7 @@ public override async ValueTask FetchAllTransfersAsync(string timefra var _result = new Transfers(); var _markets = await publicApi.LoadMarketsAsync(); - if (_markets.success == true) + if (_markets.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -335,7 +335,7 @@ public override async ValueTask FetchAllTransfersAsync(string timefra _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject>(_json_value.Content); { @@ -373,7 +373,7 @@ public override async ValueTask FetchBalanceAsync(string base_name, str var _result = new Balance(); var _currency_id = await publicApi.LoadCurrencyIdAsync(base_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -384,7 +384,7 @@ public override async ValueTask FetchBalanceAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject>(_json_value.Content); { @@ -422,7 +422,7 @@ public override async ValueTask FetchBalancesAsync(Dictionary FetchBalancesAsync(Dictionary>(_json_value.Content); { diff --git a/src/exchanges/kor/upbit/public/publicApi.cs b/src/exchanges/kor/upbit/public/publicApi.cs index 44964cf..825dba1 100644 --- a/src/exchanges/kor/upbit/public/publicApi.cs +++ b/src/exchanges/kor/upbit/public/publicApi.cs @@ -52,7 +52,7 @@ public override async ValueTask FetchMarketsAsync(Dictionary>(_json_value.Content); foreach (var _market in _markets) @@ -123,7 +123,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin var _result = new Ticker(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -139,7 +139,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _tickers = publicClient.DeserializeObject>(_json_value.Content); { @@ -184,7 +184,7 @@ public override async ValueTask FetchTickersAsync(Dictionary FetchTickersAsync(Dictionary>(_json_value.Content); { @@ -252,7 +252,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam var _result = new OrderBooks(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -268,7 +268,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orderbooks = publicClient.DeserializeObject>(_json_value.Content); { @@ -321,7 +321,7 @@ public override async ValueTask FetchOHLCVsAsync(string base_name, strin var _result = new OHLCVs(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -345,7 +345,7 @@ public override async ValueTask FetchOHLCVsAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject>(_json_value.Content); { @@ -383,7 +383,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string var _result = new CompleteOrders(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -403,7 +403,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject>(_json_value.Content); { diff --git a/src/exchanges/kor/upbit/trade/tradeApi.cs b/src/exchanges/kor/upbit/trade/tradeApi.cs index b3382ae..57212fd 100644 --- a/src/exchanges/kor/upbit/trade/tradeApi.cs +++ b/src/exchanges/kor/upbit/trade/tradeApi.cs @@ -65,7 +65,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -81,7 +81,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -112,7 +112,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -131,7 +131,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orders = tradeClient.DeserializeObject>(_json_value.Content); { @@ -163,7 +163,7 @@ public override async ValueTask FetchAllOpenOrdersAsync(Dictionary FetchAllOpenOrdersAsync(Dictionary>(_json_value.Content); { @@ -218,7 +218,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s var _result = new MyTrades(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -240,7 +240,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); { @@ -282,7 +282,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -304,7 +304,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { @@ -339,7 +339,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -355,7 +355,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { diff --git a/src/exchanges/kor/upbit/upbit.cs b/src/exchanges/kor/upbit/upbit.cs index e355994..ca807de 100644 --- a/src/exchanges/kor/upbit/upbit.cs +++ b/src/exchanges/kor/upbit/upbit.cs @@ -175,7 +175,7 @@ public override async ValueTask CreatePostRequestAsync(string endpo { var _request = await base.CreatePostRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _nonce = GenerateOnlyNonce(13); @@ -210,7 +210,7 @@ public override async ValueTask CreateGetRequestAsync(string endpoi { var _request = await base.CreateGetRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _nonce = GenerateOnlyNonce(13); @@ -245,12 +245,12 @@ public override async ValueTask CreateDeleteRequestAsync(string end { var _request = await base.CreateDeleteRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _nonce = GenerateOnlyNonce(13); var _post_params = _request.Parameters.ToDictionary(p => p.Name, p => p.Value); - + var _post_data = ToQueryString(_post_params); { var _payload = new JwtPayload @@ -308,7 +308,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) } } - if (_result.success == true && response.IsSuccessful == false) + if (_result.success && response.IsSuccessful == false) { _result.SetFailure( response.ErrorMessage ?? response.StatusDescription, diff --git a/src/exchanges/sey/bitmex/bitmex.cs b/src/exchanges/sey/bitmex/bitmex.cs index a28c4e6..04c9ab4 100644 --- a/src/exchanges/sey/bitmex/bitmex.cs +++ b/src/exchanges/sey/bitmex/bitmex.cs @@ -155,7 +155,7 @@ public override async ValueTask CreatePostRequestAsync(string endpo { var _request = await base.CreatePostRequestAsync(endpoint); - if (IsAuthentication == true) + if (IsAuthentication) { //var _post_data = ToQueryString(_request.Parameters); //_request.RemoveParameters(); @@ -192,7 +192,7 @@ public override async ValueTask CreatePutRequestAsync(string endpoi { var _request = await base.CreatePutRequestAsync(endpoint); - if (IsAuthentication == true) + if (IsAuthentication) { var _nonce = (GenerateOnlyNonce(10) + 3600).ToString(); @@ -224,7 +224,7 @@ public override async ValueTask CreateGetRequestAsync(string endpoi { var _request = await base.CreateGetRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _post_params = _request.Parameters.ToDictionary(p => p.Name, p => p.Value); @@ -256,7 +256,7 @@ public override async ValueTask CreateDeleteRequestAsync(string end { var _request = await base.CreateDeleteRequestAsync(endpoint); - if (IsAuthentication == true) + if (IsAuthentication) { //var _post_data = ToQueryString(_request.Parameters); //_request.RemoveParameters(); @@ -342,7 +342,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) var _error_msg = _json_message.Value(); if (String.IsNullOrEmpty(_error_msg) == false) { - if (ErrorMessages.ContainsKey(_error_msg) == true) + if (ErrorMessages.ContainsKey(_error_msg)) _error_code = ErrorMessages[_error_msg]; } else @@ -366,7 +366,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) } } - if (_result.success == true && response.IsSuccessful == false) + if (_result.success && response.IsSuccessful == false) { _result.SetFailure( response.ErrorMessage ?? response.StatusDescription, diff --git a/src/exchanges/sey/bitmex/private/privateApi.cs b/src/exchanges/sey/bitmex/private/privateApi.cs index fe041ac..a883e77 100644 --- a/src/exchanges/sey/bitmex/private/privateApi.cs +++ b/src/exchanges/sey/bitmex/private/privateApi.cs @@ -76,7 +76,7 @@ public override async ValueTask
FetchAddressAsync(string currency_name, var _result = new Address(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -92,7 +92,7 @@ public override async ValueTask
FetchAddressAsync(string currency_name, _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _address = _json_value.Content; { @@ -125,7 +125,7 @@ public override async ValueTask CoinWithdrawAsync(string currency_name var _result = new Transfer(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -143,7 +143,7 @@ public override async ValueTask CoinWithdrawAsync(string currency_name _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); if (String.IsNullOrEmpty(_json_data.transferId) == false) @@ -204,7 +204,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n var _result = new Transfers(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -223,7 +223,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject>(_json_value.Content); { @@ -286,7 +286,7 @@ public override async ValueTask FetchBalanceAsync(string base_name, str var _result = new Balance(); var _currency_id = await publicApi.LoadCurrencyIdAsync(base_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -302,7 +302,7 @@ public override async ValueTask FetchBalanceAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _balance = privateClient.DeserializeObject(_json_value.Content); { @@ -341,7 +341,7 @@ public override async ValueTask FetchBalancesAsync(Dictionary FetchBalancesAsync(Dictionary>(_json_value.Content); { @@ -411,7 +411,7 @@ public async Task FetchUserInfo(Dictionary args = nul _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _user_info = privateClient.DeserializeObject(_json_value.Content); _result.result = _user_info; @@ -449,7 +449,7 @@ public async Task SendChatMessage(string message, int channelId, Dicti _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _chatting = privateClient.DeserializeObject(_json_value.Content); { diff --git a/src/exchanges/sey/bitmex/public/publicApi.cs b/src/exchanges/sey/bitmex/public/publicApi.cs index e146761..1dae798 100644 --- a/src/exchanges/sey/bitmex/public/publicApi.cs +++ b/src/exchanges/sey/bitmex/public/publicApi.cs @@ -63,7 +63,7 @@ public override async ValueTask FetchMarketsAsync(Dictionary>(_json_value.Content); foreach (var _m in _markets) @@ -199,7 +199,7 @@ public async Task FetchLeaderBoard(Dictionary args var _json_leader = await publicClient.CallApiGet1Async("/api/v1/leaderboard", _params); var _leaderboard_result = publicClient.GetResponseMessage(_json_leader.Response); - if (_leaderboard_result.success == true) + if (_leaderboard_result.success) { #if DEBUG _result.rawJson = _json_leader.Content; @@ -231,11 +231,11 @@ public override async ValueTask FetchTickerAsync(string base_name, strin var _result = new Ticker(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); - var _timevalue = (args != null && args.ContainsKey("timeframe") == true) ? args["timeframe"].ToString() : "1d"; + var _timevalue = (args != null && args.ContainsKey("timeframe")) ? args["timeframe"].ToString() : "1d"; var _timeframe = publicClient.ExchangeInfo.GetTimeframe(_timevalue); var _timestamp = publicClient.ExchangeInfo.GetTimestamp(_timevalue); @@ -255,7 +255,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin var _json_trade = await publicClient.CallApiGet1Async("/api/v1/trade/bucketed", _params); var _trade_result = publicClient.GetResponseMessage(_json_trade.Response); - if (_trade_result.success == true) + if (_trade_result.success) { #if DEBUG _result.rawJson = _json_trade.Content; @@ -265,7 +265,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin var _json_quote = await publicClient.CallApiGet1Async("/api/v1/quote/bucketed", _params); var _quote_result = publicClient.GetResponseMessage(_json_quote.Response); - if (_quote_result.success == true) + if (_quote_result.success) { #if DEBUG _result.rawJson += _json_quote.Content; @@ -311,7 +311,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam var _result = new OrderBooks(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -328,7 +328,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orderbooks = publicClient.DeserializeObject>(_json_value.Content); { @@ -380,7 +380,7 @@ public override async ValueTask FetchOHLCVsAsync(string base_name, strin var _result = new OHLCVs(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -407,7 +407,7 @@ public override async ValueTask FetchOHLCVsAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject>(_json_value.Content); @@ -454,7 +454,7 @@ public async Task FetchUdfHistory(string base_name, string quote_name, s var _result = new OHLCVs(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -473,7 +473,7 @@ public async Task FetchUdfHistory(string base_name, string quote_name, s _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject(_json_value.Content); if (_json_data.s == "ok") @@ -523,7 +523,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string var _result = new CompleteOrders(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -548,7 +548,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject>(_json_value.Content); { diff --git a/src/exchanges/sey/bitmex/trade/tradeApi.cs b/src/exchanges/sey/bitmex/trade/tradeApi.cs index 380692f..82aaed9 100644 --- a/src/exchanges/sey/bitmex/trade/tradeApi.cs +++ b/src/exchanges/sey/bitmex/trade/tradeApi.cs @@ -80,7 +80,7 @@ public override async ValueTask FetchMyOrdersAsync(string base_name, s var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -103,7 +103,7 @@ public override async ValueTask FetchMyOrdersAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); { @@ -142,7 +142,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -167,7 +167,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { //var _multiplier = publicApi.publicClient.ExchangeInfo.GetAmountMultiplier(_market.result.symbol, 1.0m); @@ -204,7 +204,7 @@ public override async ValueTask FetchAllOpenOrdersAsync(Dictionary FetchAllOpenOrdersAsync(Dictionary>(_json_value.Content); - foreach (var _o in _orders.Where(o => OrderStatusConverter.IsAlive(o.orderStatus) == true)) + foreach (var _o in _orders.Where(o => OrderStatusConverter.IsAlive(o.orderStatus))) { //var _multiplier = publicApi.publicClient.ExchangeInfo.GetAmountMultiplier(_o.symbol, 1.0m); @@ -267,7 +267,7 @@ public override async ValueTask FetchOpenPositionsAsync(string base var _result = new MyPositions(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -290,7 +290,7 @@ public override async ValueTask FetchOpenPositionsAsync(string base _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); { @@ -332,7 +332,7 @@ public override async ValueTask FetchAllOpenPositionsAsync(Dictiona var _result = new MyPositions(); var _markets = await publicApi.LoadMarketsAsync(); - if (_markets.success == true) + if (_markets.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -343,7 +343,7 @@ public override async ValueTask FetchAllOpenPositionsAsync(Dictiona _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); { @@ -390,7 +390,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s var _result = new MyTrades(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -414,7 +414,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); { @@ -456,7 +456,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -479,7 +479,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -520,7 +520,7 @@ public override async ValueTask CreateMarketOrderAsync(string base_name var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -542,7 +542,7 @@ public override async ValueTask CreateMarketOrderAsync(string base_name _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -590,7 +590,7 @@ public async Task CreateBulkOrder(List orders, Diction _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orders = tradeClient.DeserializeObject>(_json_value.Content); { @@ -618,7 +618,7 @@ public async Task ClosePosition(string base_name, string quote_name, Or var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -638,7 +638,7 @@ public async Task ClosePosition(string base_name, string quote_name, Or _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -669,7 +669,7 @@ public async Task ChooseLeverage(string base_name, string quote_name var _result = new MyPosition(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -687,7 +687,7 @@ public async Task ChooseLeverage(string base_name, string quote_name _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _position = tradeClient.DeserializeObject(_json_value.Content); { @@ -721,7 +721,7 @@ public async Task UpdateOrder(string base_name, string quote_name, stri var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -740,7 +740,7 @@ public async Task UpdateOrder(string base_name, string quote_name, stri _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); _result.result = _json_data; @@ -781,7 +781,7 @@ public async Task UpdateOrders(List orders, Dict _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orders = tradeClient.DeserializeObject>(_json_value.Content); { @@ -811,7 +811,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -828,7 +828,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); @@ -866,7 +866,7 @@ public override async ValueTask CancelOrdersAsync(string base_name, st var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -883,7 +883,7 @@ public override async ValueTask CancelOrdersAsync(string base_name, st _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); { @@ -911,7 +911,7 @@ public override async ValueTask CancelAllOrdersAsync(Dictionary CancelAllOrdersAsync(Dictionary>(_json_value.Content); { diff --git a/src/exchanges/usa/bittrex/bittrex.cs b/src/exchanges/usa/bittrex/bittrex.cs index 4bd8a29..6ecc3fe 100644 --- a/src/exchanges/usa/bittrex/bittrex.cs +++ b/src/exchanges/usa/bittrex/bittrex.cs @@ -154,7 +154,7 @@ public override async ValueTask CreatePostRequestAsync(string endpo { var _request = await base.CreatePostRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _nonce = GenerateOnlyNonce(16).ToString(); @@ -162,7 +162,7 @@ public override async ValueTask CreatePostRequestAsync(string endpo _request.AddParameter("apikey", ConnectKey); var _post_params = _request.Parameters.ToDictionary(p => p.Name, p => p.Value); - + var _post_data = ToQueryString(_post_params); { _request.Resource += "?" + _post_data; @@ -186,7 +186,7 @@ public override async ValueTask CreateGetRequestAsync(string endpoi { var _request = await base.CreateGetRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _nonce = GenerateOnlyNonce(16).ToString(); @@ -294,7 +294,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) } } } - else if (ErrorMessages.ContainsKey(_error_msg) == true) + else if (ErrorMessages.ContainsKey(_error_msg)) { _error_code = ErrorMessages[_error_msg]; _error_msg = response.Content; @@ -323,7 +323,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) } } - if (_result.success == true && response.IsSuccessful == false) + if (_result.success && response.IsSuccessful == false) { _result.SetFailure( response.ErrorMessage ?? response.StatusDescription, diff --git a/src/exchanges/usa/bittrex/private/privateApi.cs b/src/exchanges/usa/bittrex/private/privateApi.cs index 4a91e80..f6a394c 100644 --- a/src/exchanges/usa/bittrex/private/privateApi.cs +++ b/src/exchanges/usa/bittrex/private/privateApi.cs @@ -66,7 +66,7 @@ public override async ValueTask
FetchAddressAsync(string currency_name, var _result = new Address(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -82,7 +82,7 @@ public override async ValueTask
FetchAddressAsync(string currency_name, _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); { @@ -117,7 +117,7 @@ public override async ValueTask CoinWithdrawAsync(string currency_name var _result = new Transfer(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -135,10 +135,10 @@ public override async ValueTask CoinWithdrawAsync(string currency_name _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _transfer = new BWithdrawItem { @@ -192,7 +192,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n var _result = new Transfers(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { var _timestamp = privateClient.ExchangeInfo.GetTimestamp(timeframe); var _timeframe = privateClient.ExchangeInfo.GetTimeframe(timeframe); @@ -213,10 +213,10 @@ public override async ValueTask FetchTransfersAsync(string currency_n _result.rawJson += _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _deposits = _json_data.result .Where(d => d.timestamp >= since) @@ -225,10 +225,10 @@ public override async ValueTask FetchTransfersAsync(string currency_n foreach (var _d in _deposits) { - if (String.IsNullOrEmpty(_d.transactionId) == true) + if (String.IsNullOrEmpty(_d.transactionId)) continue; - _d.transactionType = _d.pendingPayment == true + _d.transactionType = _d.pendingPayment ? TransactionType.Depositing : TransactionType.Deposit; @@ -247,7 +247,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n } // TransactionType.Withdrawal - if (_result.success == true) + if (_result.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -256,10 +256,10 @@ public override async ValueTask FetchTransfersAsync(string currency_n _result.rawJson += _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _withdraws = _json_data.result .Where(w => w.timestamp >= since) @@ -268,10 +268,10 @@ public override async ValueTask FetchTransfersAsync(string currency_n foreach (var _w in _withdraws) { - if (String.IsNullOrEmpty(_w.transactionId) == true) + if (String.IsNullOrEmpty(_w.transactionId)) continue; - _w.transactionType = _w.pendingPayment == true + _w.transactionType = _w.pendingPayment ? TransactionType.Withdrawing : TransactionType.Withdraw; @@ -311,7 +311,7 @@ public override async ValueTask FetchAllTransfersAsync(string timefra var _result = new Transfers(); var _markets = await publicApi.LoadMarketsAsync(); - if (_markets.success == true) + if (_markets.success) { var _timestamp = privateClient.ExchangeInfo.GetTimestamp(timeframe); var _timeframe = privateClient.ExchangeInfo.GetTimeframe(timeframe); @@ -327,10 +327,10 @@ public override async ValueTask FetchAllTransfersAsync(string timefra _result.rawJson += _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _deposits = _json_data.result .Where(d => d.timestamp >= since) @@ -339,10 +339,10 @@ public override async ValueTask FetchAllTransfersAsync(string timefra foreach (var _d in _deposits) { - if (String.IsNullOrEmpty(_d.transactionId) == true) + if (String.IsNullOrEmpty(_d.transactionId)) continue; - _d.transactionType = _d.pendingPayment == true + _d.transactionType = _d.pendingPayment ? TransactionType.Depositing : TransactionType.Deposit; @@ -359,7 +359,7 @@ public override async ValueTask FetchAllTransfersAsync(string timefra } // TransactionType.Withdrawal - if (_result.success == true) + if (_result.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -368,10 +368,10 @@ public override async ValueTask FetchAllTransfersAsync(string timefra _result.rawJson += _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _withdraws = _json_data.result .Where(w => w.timestamp >= since) @@ -380,10 +380,10 @@ public override async ValueTask FetchAllTransfersAsync(string timefra foreach (var _w in _withdraws) { - if (String.IsNullOrEmpty(_w.transactionId) == true) + if (String.IsNullOrEmpty(_w.transactionId)) continue; - _w.transactionType = _w.pendingPayment == true + _w.transactionType = _w.pendingPayment ? TransactionType.Withdrawing : TransactionType.Withdraw; @@ -419,7 +419,7 @@ public override async ValueTask FetchBalanceAsync(string base_name, str var _result = new Balance(); var _currency_id = await publicApi.LoadCurrencyIdAsync(base_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -435,10 +435,10 @@ public override async ValueTask FetchBalanceAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _balance = privateClient.DeserializeObject(_json_value.Content); - if (_balance.success == true) + if (_balance.success) { //_balance.total = _balance.free + _balance.used; _balance.result.currency = base_name; @@ -471,7 +471,7 @@ public override async ValueTask FetchBalancesAsync(Dictionary FetchBalancesAsync(Dictionary(_json_value.Content); { diff --git a/src/exchanges/usa/bittrex/public/publicApi.cs b/src/exchanges/usa/bittrex/public/publicApi.cs index e4790f6..b4f5990 100644 --- a/src/exchanges/usa/bittrex/public/publicApi.cs +++ b/src/exchanges/usa/bittrex/public/publicApi.cs @@ -53,7 +53,7 @@ public override async ValueTask FetchMarketsAsync(Dictionary(_json_value.Content); @@ -63,7 +63,7 @@ public override async ValueTask FetchMarketsAsync(Dictionary FetchTickerAsync(string base_name, strin var _result = new Ticker(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -136,7 +136,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_tickers = publicClient.DeserializeObject(_json_value.Content); { @@ -167,7 +167,7 @@ public override async ValueTask FetchTickersAsync(Dictionary FetchTickersAsync(Dictionary(_json_value.Content); { @@ -212,7 +212,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam var _result = new OrderBooks(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -229,10 +229,10 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orderbook = publicClient.DeserializeObject(_json_value.Content); - if (_orderbook.success == true) + if (_orderbook.success) { _result.result.asks = _orderbook.result.asks.OrderBy(o => o.price).Take(limits).ToList(); _result.result.bids = _orderbook.result.bids.OrderByDescending(o => o.price).Take(limits).ToList(); @@ -272,7 +272,7 @@ public override async ValueTask FetchOHLCVsAsync(string base_name, strin var _result = new OHLCVs(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -294,10 +294,10 @@ public override async ValueTask FetchOHLCVsAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _ohlcvs = publicClient.DeserializeObject(_json_value.Content); - if (_ohlcvs.success == true) + if (_ohlcvs.success) { _result.result.AddRange( _ohlcvs.result @@ -337,7 +337,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string var _result = new CompleteOrders(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -356,7 +356,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject(_json_value.Content); { diff --git a/src/exchanges/usa/bittrex/trade/order.cs b/src/exchanges/usa/bittrex/trade/order.cs index cb21a49..46d602b 100644 --- a/src/exchanges/usa/bittrex/trade/order.cs +++ b/src/exchanges/usa/bittrex/trade/order.cs @@ -116,7 +116,7 @@ private bool statusValue { set { - orderStatus = value == true ? OrderStatus.Open : OrderStatus.Closed; + orderStatus = value ? OrderStatus.Open : OrderStatus.Closed; } } diff --git a/src/exchanges/usa/bittrex/trade/tradeApi.cs b/src/exchanges/usa/bittrex/trade/tradeApi.cs index c239ce7..18ea175 100644 --- a/src/exchanges/usa/bittrex/trade/tradeApi.cs +++ b/src/exchanges/usa/bittrex/trade/tradeApi.cs @@ -66,7 +66,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -82,7 +82,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -115,7 +115,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -131,7 +131,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orders = tradeClient.DeserializeObject(_json_value.Content); { @@ -166,7 +166,7 @@ public override async ValueTask FetchAllOpenOrdersAsync(Dictionary FetchAllOpenOrdersAsync(Dictionary(_json_value.Content); { @@ -217,7 +217,7 @@ public override async ValueTask FetchMyOrdersAsync(string base_name, s var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -231,7 +231,7 @@ public override async ValueTask FetchMyOrdersAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { @@ -273,7 +273,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -293,7 +293,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { @@ -341,7 +341,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -357,10 +357,10 @@ public override async ValueTask CancelOrderAsync(string base_name, stri _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _order = new BPlaceOrderItem { diff --git a/src/exchanges/usa/gdax/gdax.cs b/src/exchanges/usa/gdax/gdax.cs index bb7b013..88c03d9 100644 --- a/src/exchanges/usa/gdax/gdax.cs +++ b/src/exchanges/usa/gdax/gdax.cs @@ -149,7 +149,7 @@ public override async ValueTask CreatePostRequestAsync(string endpo { var _request = await base.CreatePostRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _params = new Dictionary(); { @@ -189,7 +189,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) if (response != null) { - if (response.IsSuccessful == true) + if (response.IsSuccessful) { var _json_result = this.DeserializeObject(response.Content); @@ -203,7 +203,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) } } - if (_result.success == true && response.IsSuccessful == false) + if (_result.success && response.IsSuccessful == false) { _result.SetFailure( response.ErrorMessage ?? response.StatusDescription, diff --git a/src/exchanges/usa/gdax/private/privateApi.cs b/src/exchanges/usa/gdax/private/privateApi.cs index 586a394..70f93c7 100644 --- a/src/exchanges/usa/gdax/private/privateApi.cs +++ b/src/exchanges/usa/gdax/private/privateApi.cs @@ -72,7 +72,7 @@ public override async ValueTask CoinWithdrawAsync(string currency_name var _result = new Transfer(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -90,7 +90,7 @@ public override async ValueTask CoinWithdrawAsync(string currency_name _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); if (String.IsNullOrEmpty(_json_data.transferId) == false) @@ -144,7 +144,7 @@ public override async ValueTask FetchBalanceAsync(string base_name, str var _result = new Balance(); var _currency_id = await publicApi.LoadCurrencyIdAsync(base_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -155,7 +155,7 @@ public override async ValueTask FetchBalanceAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _balances = privateClient.DeserializeObject>(_json_value.Content); { @@ -193,7 +193,7 @@ public override async ValueTask FetchBalancesAsync(Dictionary FetchBalancesAsync(Dictionary>(_json_value.Content); { diff --git a/src/exchanges/usa/gdax/public/publicApi.cs b/src/exchanges/usa/gdax/public/publicApi.cs index fe2cab5..fc7b926 100644 --- a/src/exchanges/usa/gdax/public/publicApi.cs +++ b/src/exchanges/usa/gdax/public/publicApi.cs @@ -55,7 +55,7 @@ public override async ValueTask FetchMarketsAsync(Dictionary>(_json_value.Content); foreach (var _market in _products) @@ -140,7 +140,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin var _result = new Ticker(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -151,7 +151,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _ticker = publicClient.DeserializeObject(_json_value.Content); { @@ -183,7 +183,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam var _result = new OrderBooks(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -202,7 +202,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orderbook = publicClient.DeserializeObject(_json_value.Content); { @@ -240,7 +240,7 @@ public override async ValueTask FetchOHLCVsAsync(string base_name, strin var _result = new OHLCVs(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -265,7 +265,7 @@ public override async ValueTask FetchOHLCVsAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject(_json_value.Content); @@ -311,7 +311,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string var _result = new CompleteOrders(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -325,7 +325,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject>(_json_value.Content); { diff --git a/src/exchanges/usa/gdax/trade/tradeApi.cs b/src/exchanges/usa/gdax/trade/tradeApi.cs index b10274d..29ca103 100644 --- a/src/exchanges/usa/gdax/trade/tradeApi.cs +++ b/src/exchanges/usa/gdax/trade/tradeApi.cs @@ -73,7 +73,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -84,7 +84,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -119,7 +119,7 @@ public override async ValueTask FetchMyOrdersAsync(string base_name, s var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -138,7 +138,7 @@ public override async ValueTask FetchMyOrdersAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); { @@ -177,7 +177,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -194,7 +194,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orders = tradeClient.DeserializeObject>(_json_value.Content); { @@ -226,7 +226,7 @@ public override async ValueTask FetchAllOpenOrdersAsync(Dictionary FetchAllOpenOrdersAsync(Dictionary>(_json_value.Content); { @@ -279,7 +279,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s var _result = new MyTrades(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -298,7 +298,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); { @@ -344,7 +344,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -366,7 +366,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -406,7 +406,7 @@ public override async ValueTask CreateMarketOrderAsync(string base_name var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -427,7 +427,7 @@ public override async ValueTask CreateMarketOrderAsync(string base_name _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -464,7 +464,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -475,7 +475,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); if (_json_data != null) @@ -527,7 +527,7 @@ public override async ValueTask CancelOrdersAsync(string base_name, st var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -543,7 +543,7 @@ public override async ValueTask CancelOrdersAsync(string base_name, st _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { @@ -584,7 +584,7 @@ public override async ValueTask CancelAllOrdersAsync(Dictionary CancelAllOrdersAsync(Dictionary(_json_value.Content); { diff --git a/src/exchanges/usa/gemini/gemini.cs b/src/exchanges/usa/gemini/gemini.cs index 53bfc5d..31cd9f6 100644 --- a/src/exchanges/usa/gemini/gemini.cs +++ b/src/exchanges/usa/gemini/gemini.cs @@ -140,7 +140,7 @@ public override async ValueTask CreatePostRequestAsync(string endpo { var _request = await base.CreatePostRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _params = new Dictionary(); { @@ -231,7 +231,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) var _error_msg = _json_message.Value(); var _reason = _json_reason.Value(); - if (ErrorMessages.ContainsKey(_reason) == true) + if (ErrorMessages.ContainsKey(_reason)) { _error_msg = ErrorMessages[_reason]; @@ -245,7 +245,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) } } - if (_result.success == true && response.IsSuccessful == false) + if (_result.success && response.IsSuccessful == false) { _result.SetFailure( response.ErrorMessage ?? response.StatusDescription, diff --git a/src/exchanges/usa/gemini/private/privateApi.cs b/src/exchanges/usa/gemini/private/privateApi.cs index ff02630..a03665e 100644 --- a/src/exchanges/usa/gemini/private/privateApi.cs +++ b/src/exchanges/usa/gemini/private/privateApi.cs @@ -65,7 +65,7 @@ public override async ValueTask
CreateAddressAsync(string currency_name var _result = new Address(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -76,7 +76,7 @@ public override async ValueTask
CreateAddressAsync(string currency_name _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _address = privateClient.DeserializeObject(_json_value.Content); { @@ -113,7 +113,7 @@ public override async ValueTask CoinWithdrawAsync(string currency_name var _result = new Transfer(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -130,7 +130,7 @@ public override async ValueTask CoinWithdrawAsync(string currency_name _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); if (String.IsNullOrEmpty(_json_data.transactionId) == false) @@ -187,7 +187,7 @@ public override async ValueTask FetchAllTransfersAsync(string timefra var _result = new Transfers(); var _markets = await publicApi.LoadMarketsAsync(); - if (_markets.success == true) + if (_markets.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -202,7 +202,7 @@ public override async ValueTask FetchAllTransfersAsync(string timefra _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject>(_json_value.Content); { @@ -213,7 +213,7 @@ public override async ValueTask FetchAllTransfersAsync(string timefra foreach (var _t in _transfers) { - if (String.IsNullOrEmpty(_t.transactionId) == true) + if (String.IsNullOrEmpty(_t.transactionId)) _t.transactionId = (_t.timestamp * 1000).ToString(); if (_t.transactionType == TransactionType.Deposit) @@ -246,7 +246,7 @@ public override async ValueTask FetchBalanceAsync(string base_name, str var _result = new Balance(); var _currency_id = await publicApi.LoadCurrencyIdAsync(base_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -257,7 +257,7 @@ public override async ValueTask FetchBalanceAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _balances = privateClient.DeserializeObject>(_json_value.Content); { @@ -295,7 +295,7 @@ public override async ValueTask FetchBalancesAsync(Dictionary FetchBalancesAsync(Dictionary>(_json_value.Content); { diff --git a/src/exchanges/usa/gemini/public/publicApi.cs b/src/exchanges/usa/gemini/public/publicApi.cs index 349e66a..1b277e9 100644 --- a/src/exchanges/usa/gemini/public/publicApi.cs +++ b/src/exchanges/usa/gemini/public/publicApi.cs @@ -54,7 +54,7 @@ public override async ValueTask FetchMarketsAsync(Dictionary(_json_value.Content); foreach (var _market in _symbols) @@ -139,7 +139,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin var _result = new Ticker(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -150,7 +150,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _ticker = publicClient.DeserializeObject(_json_value.Content); { @@ -182,7 +182,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam var _result = new OrderBooks(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -199,7 +199,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orderbook = publicClient.DeserializeObject(_json_value.Content); { @@ -237,7 +237,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string var _result = new CompleteOrders(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -268,7 +268,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject>(_json_value.Content); { diff --git a/src/exchanges/usa/gemini/trade/order.cs b/src/exchanges/usa/gemini/trade/order.cs index 79cd61b..ac7b633 100644 --- a/src/exchanges/usa/gemini/trade/order.cs +++ b/src/exchanges/usa/gemini/trade/order.cs @@ -155,9 +155,9 @@ public override OrderStatus orderStatus { get { - base.orderStatus = (is_live == true && filled == 0) ? OrderStatus.Open - : (is_live == true && filled > 0) ? OrderStatus.Partially - : is_cancelled == true ? OrderStatus.Canceled + base.orderStatus = (is_live && filled == 0) ? OrderStatus.Open + : (is_live && filled > 0) ? OrderStatus.Partially + : is_cancelled ? OrderStatus.Canceled : OrderStatus.Closed; return base.orderStatus; diff --git a/src/exchanges/usa/gemini/trade/tradeApi.cs b/src/exchanges/usa/gemini/trade/tradeApi.cs index 69c822a..ebadb58 100644 --- a/src/exchanges/usa/gemini/trade/tradeApi.cs +++ b/src/exchanges/usa/gemini/trade/tradeApi.cs @@ -67,7 +67,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -83,7 +83,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -112,7 +112,7 @@ public override async ValueTask FetchAllOpenOrdersAsync(Dictionary FetchAllOpenOrdersAsync(Dictionary>(_json_value.Content); { @@ -160,7 +160,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s var _result = new MyTrades(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -181,7 +181,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); { @@ -223,7 +223,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -245,15 +245,15 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { _order.amount = (_order.quantity * _order.price).Normalize(); _order.fee = _order.amount * tradeClient.ExchangeInfo.Fees.trading.maker; - _order.orderStatus = _order.is_live == true && _order.quantity == _order.remaining ? OrderStatus.Open - : _order.is_live == true && _order.quantity != _order.remaining ? OrderStatus.Partially - : _order.is_cancelled == true ? OrderStatus.Canceled + _order.orderStatus = _order.is_live && _order.quantity == _order.remaining ? OrderStatus.Open + : _order.is_live && _order.quantity != _order.remaining ? OrderStatus.Partially + : _order.is_cancelled ? OrderStatus.Canceled : _order.remaining == 0 ? OrderStatus.Closed : OrderStatus.Unknown; @@ -289,7 +289,7 @@ public override async ValueTask CreateMarketOrderAsync(string base_name var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -312,15 +312,15 @@ public override async ValueTask CreateMarketOrderAsync(string base_name _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { _order.amount = (_order.quantity * _order.price).Normalize(); _order.fee = _order.amount * tradeClient.ExchangeInfo.Fees.trading.maker; - _order.orderStatus = _order.is_live == true && _order.quantity == _order.remaining ? OrderStatus.Open - : _order.is_live == true && _order.quantity != _order.remaining ? OrderStatus.Partially - : _order.is_cancelled == true ? OrderStatus.Canceled + _order.orderStatus = _order.is_live && _order.quantity == _order.remaining ? OrderStatus.Open + : _order.is_live && _order.quantity != _order.remaining ? OrderStatus.Partially + : _order.is_cancelled ? OrderStatus.Canceled : _order.remaining == 0 ? OrderStatus.Closed : OrderStatus.Unknown; @@ -354,7 +354,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -370,7 +370,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -408,7 +408,7 @@ public override async ValueTask CancelAllOrdersAsync(Dictionary CancelAllOrdersAsync(Dictionary(_json_value.Content); { diff --git a/src/exchanges/usa/itbit/itbit.cs b/src/exchanges/usa/itbit/itbit.cs index 33b8427..a2e5eef 100644 --- a/src/exchanges/usa/itbit/itbit.cs +++ b/src/exchanges/usa/itbit/itbit.cs @@ -153,7 +153,7 @@ public override async ValueTask CreateGetRequestAsync(string endpoi { var _request = await base.CreateGetRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _post_params = _request.Parameters.ToDictionary(p => p.Name, p => p.Value); @@ -201,7 +201,7 @@ public override async ValueTask CreatePostRequestAsync(string endpo { var _request = await base.CreatePostRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _params = new Dictionary(); { @@ -255,7 +255,7 @@ public override async ValueTask CreateDeleteRequestAsync(string end { var _request = await base.CreateDeleteRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _params = new Dictionary(); { @@ -330,7 +330,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) } } - if (_result.success == true && response.IsSuccessful == false) + if (_result.success && response.IsSuccessful == false) { _result.SetFailure( response.ErrorMessage ?? response.StatusDescription, diff --git a/src/exchanges/usa/itbit/private/privateApi.cs b/src/exchanges/usa/itbit/private/privateApi.cs index 88f57e3..bd6a611 100644 --- a/src/exchanges/usa/itbit/private/privateApi.cs +++ b/src/exchanges/usa/itbit/private/privateApi.cs @@ -70,7 +70,7 @@ public override async ValueTask FetchAllTransfersAsync(string timefra var _result = new Transfers(); var _markets = await publicApi.LoadMarketsAsync(); - if (_markets.success == true) + if (_markets.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -81,7 +81,7 @@ public override async ValueTask FetchAllTransfersAsync(string timefra _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); { @@ -146,7 +146,7 @@ public override async ValueTask FetchWalletsAsync(string user_id, Dicti _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject>(_json_value.Content); { @@ -197,7 +197,7 @@ public override async ValueTask FetchBalanceAsync(string base_name, str var _result = new Balance(); var _currency_id = await publicApi.LoadCurrencyIdAsync(base_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -207,7 +207,7 @@ public override async ValueTask FetchBalanceAsync(string base_name, str { privateClient.MergeParamsAndArgs(_params, args); - if (_params.ContainsKey("walletId") == true) + if (_params.ContainsKey("walletId")) { _wallet_id = _params["walletId"].ToString(); _params.Remove("walletId"); @@ -219,7 +219,7 @@ public override async ValueTask FetchBalanceAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _balance = privateClient.DeserializeObject(_json_value.Content); { @@ -250,7 +250,7 @@ public override async ValueTask FetchBalancesAsync(Dictionary FetchBalancesAsync(Dictionary FetchBalancesAsync(Dictionary(_json_value.Content); { diff --git a/src/exchanges/usa/itbit/public/publicApi.cs b/src/exchanges/usa/itbit/public/publicApi.cs index 1c08f50..8c7115c 100644 --- a/src/exchanges/usa/itbit/public/publicApi.cs +++ b/src/exchanges/usa/itbit/public/publicApi.cs @@ -87,7 +87,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin var _result = new Ticker(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -98,7 +98,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _ticker = publicClient.DeserializeObject(_json_value.Content); { @@ -131,7 +131,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam var _result = new OrderBooks(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -142,7 +142,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orderbook = publicClient.DeserializeObject(_json_value.Content); { @@ -180,7 +180,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string var _result = new CompleteOrders(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -194,7 +194,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject(_json_value.Content); { diff --git a/src/exchanges/usa/itbit/trade/tradeApi.cs b/src/exchanges/usa/itbit/trade/tradeApi.cs index 7f1f032..c06d570 100644 --- a/src/exchanges/usa/itbit/trade/tradeApi.cs +++ b/src/exchanges/usa/itbit/trade/tradeApi.cs @@ -72,7 +72,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -83,7 +83,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -118,7 +118,7 @@ public override async ValueTask FetchMyOrdersAsync(string base_name, s var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -137,7 +137,7 @@ public override async ValueTask FetchMyOrdersAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); { @@ -176,7 +176,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -193,12 +193,12 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); { var _orders = _json_data - .Where(o => OrderStatusConverter.IsAlive(o.orderStatus) == true) + .Where(o => OrderStatusConverter.IsAlive(o.orderStatus)) .OrderByDescending(o => o.timestamp); foreach (var _o in _orders) @@ -229,7 +229,7 @@ public override async ValueTask FetchAllOpenOrdersAsync(Dictionary FetchAllOpenOrdersAsync(Dictionary>(_json_value.Content); { var _orders = _json_data - .Where(o => OrderStatusConverter.IsAlive(o.orderStatus) == true) + .Where(o => OrderStatusConverter.IsAlive(o.orderStatus)) .OrderByDescending(o => o.timestamp); foreach (var _o in _orders) @@ -286,7 +286,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s var _result = new MyTrades(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -309,7 +309,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { @@ -353,7 +353,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -377,7 +377,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _order = tradeClient.DeserializeObject(_json_value.Content); { @@ -413,7 +413,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -424,7 +424,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { diff --git a/src/exchanges/usa/kraken/kraken.cs b/src/exchanges/usa/kraken/kraken.cs index 6e3db5d..9060279 100644 --- a/src/exchanges/usa/kraken/kraken.cs +++ b/src/exchanges/usa/kraken/kraken.cs @@ -168,7 +168,7 @@ public override async ValueTask CreatePostRequestAsync(string endpo { var _request = await base.CreatePostRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _nonce = GenerateOnlyNonce(16); _request.AddParameter("nonce", _nonce); @@ -223,7 +223,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) if (response != null) { - if (response.IsSuccessful == true) + if (response.IsSuccessful) { var _json_result = this.DeserializeObject(response.Content); @@ -277,7 +277,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) } } - if (_result.success == true && response.IsSuccessful == false) + if (_result.success && response.IsSuccessful == false) { _result.SetFailure( response.ErrorMessage ?? response.StatusDescription, diff --git a/src/exchanges/usa/kraken/private/privateApi.cs b/src/exchanges/usa/kraken/private/privateApi.cs index 4bf5938..337b4c9 100644 --- a/src/exchanges/usa/kraken/private/privateApi.cs +++ b/src/exchanges/usa/kraken/private/privateApi.cs @@ -94,7 +94,7 @@ private async Task getDepositMethod(string currency_id) _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); { @@ -130,12 +130,12 @@ public override async ValueTask
CreateAddressAsync(string currency_name var _result = new Address(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); var _deposit_method = await getDepositMethod(_currency_id.result); - if (_deposit_method.success == true) + if (_deposit_method.success) { var _params = new Dictionary(); { @@ -151,7 +151,7 @@ public override async ValueTask
CreateAddressAsync(string currency_name _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _addresses = privateClient.DeserializeObject>>(_json_value.Content); { @@ -188,12 +188,12 @@ public override async ValueTask
FetchAddressAsync(string currency_name, var _result = new Address(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); var _deposit_method = await getDepositMethod(_currency_id.result); - if (_deposit_method.success == true) + if (_deposit_method.success) { var _params = new Dictionary(); { @@ -208,7 +208,7 @@ public override async ValueTask
FetchAddressAsync(string currency_name, _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _addresses = privateClient.DeserializeObject>>(_json_value.Content); { @@ -248,7 +248,7 @@ public override async ValueTask CoinWithdrawAsync(string currency_name var _result = new Transfer(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -266,7 +266,7 @@ public override async ValueTask CoinWithdrawAsync(string currency_name _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject>(_json_value.Content); { @@ -315,7 +315,7 @@ public override async ValueTask CancelCoinWithdrawAsync(string currenc var _result = new Transfer(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -332,10 +332,10 @@ public override async ValueTask CancelCoinWithdrawAsync(string currenc _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); - if (_json_data.result == true) + if (_json_data.result) { var _transfer = new KTransferItem { @@ -385,10 +385,10 @@ public override async ValueTask FetchTransfersAsync(string currency_n var _result = new Transfers(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { var _deposit_method = await getDepositMethod(_currency_id.result); - if (_deposit_method.success == true) + if (_deposit_method.success) { var _params = new Dictionary(); { @@ -407,7 +407,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n _result.rawJson += _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject>>(_json_value.Content); { @@ -433,7 +433,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n } // TransactionType.Withdrawal - if (_result.success == true) + if (_result.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -442,7 +442,7 @@ public override async ValueTask FetchTransfersAsync(string currency_n _result.rawJson += _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject>>(_json_value.Content); { @@ -490,7 +490,7 @@ public override async ValueTask FetchBalancesAsync(Dictionary FetchBalancesAsync(Dictionary>>(_json_value.Content); { diff --git a/src/exchanges/usa/kraken/public/publicApi.cs b/src/exchanges/usa/kraken/public/publicApi.cs index 53306b0..90253f0 100644 --- a/src/exchanges/usa/kraken/public/publicApi.cs +++ b/src/exchanges/usa/kraken/public/publicApi.cs @@ -54,7 +54,7 @@ public override async ValueTask FetchMarketsAsync(Dictionary>>(_json_value.Content); @@ -73,7 +73,7 @@ public override async ValueTask FetchMarketsAsync(Dictionary FetchTickersAsync(Dictionary FetchTickersAsync(Dictionary(_json_value.Content); { @@ -199,7 +199,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam var _result = new OrderBooks(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -216,7 +216,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject(_json_value.Content); { @@ -257,7 +257,7 @@ public override async ValueTask FetchOHLCVsAsync(string base_name, strin var _result = new OHLCVs(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -280,7 +280,7 @@ public override async ValueTask FetchOHLCVsAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject(_json_value.Content); var _json_ohlcvs = JArray.FromObject((_json_data["result"] as JObject)[_market.result.symbol]); @@ -327,7 +327,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string var _result = new CompleteOrders(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -349,7 +349,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject(_json_value.Content); { diff --git a/src/exchanges/usa/kraken/trade/tradeApi.cs b/src/exchanges/usa/kraken/trade/tradeApi.cs index 5c82536..dc8dfea 100644 --- a/src/exchanges/usa/kraken/trade/tradeApi.cs +++ b/src/exchanges/usa/kraken/trade/tradeApi.cs @@ -68,7 +68,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -84,7 +84,7 @@ public override async ValueTask FetchMyOrderAsync(string base_name, str _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>>(_json_value.Content); { @@ -131,7 +131,7 @@ public override async ValueTask FetchMyOrdersAsync(string base_name, s var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -146,7 +146,7 @@ public override async ValueTask FetchMyOrdersAsync(string base_name, s _result.rawJson += _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); { @@ -171,14 +171,14 @@ public override async ValueTask FetchMyOrdersAsync(string base_name, s } // closed orders - if (_result.success == true) + if (_result.success) { var _json_value = await tradeClient.CallApiPost1Async("/0/private/ClosedOrders", _params); #if DEBUG _result.rawJson += _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); { @@ -222,7 +222,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -235,7 +235,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); { @@ -275,7 +275,7 @@ public override async ValueTask FetchAllOpenOrdersAsync(Dictionary FetchAllOpenOrdersAsync(Dictionary>(_json_value.Content); { @@ -329,7 +329,7 @@ public override async ValueTask FetchAllOpenPositionsAsync(Dictiona var _result = new MyPositions(); var _markets = await publicApi.LoadMarketsAsync(); - if (_markets.success == true) + if (_markets.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -340,7 +340,7 @@ public override async ValueTask FetchAllOpenPositionsAsync(Dictiona _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>>(_json_value.Content); { @@ -385,7 +385,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s var _result = new MyTrades(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -396,7 +396,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); { @@ -438,7 +438,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -461,7 +461,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); if (_json_data.result.transactionIds != null) @@ -522,7 +522,7 @@ public override async ValueTask CreateMarketOrderAsync(string base_name var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -545,7 +545,7 @@ public override async ValueTask CreateMarketOrderAsync(string base_name _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); { @@ -597,7 +597,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -613,7 +613,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject>(_json_value.Content); if (_json_data.result.count > 0) diff --git a/src/exchanges/usa/poloniex/poloniex.cs b/src/exchanges/usa/poloniex/poloniex.cs index d41796d..be929d3 100644 --- a/src/exchanges/usa/poloniex/poloniex.cs +++ b/src/exchanges/usa/poloniex/poloniex.cs @@ -152,7 +152,7 @@ public override async ValueTask CreatePostRequestAsync(string endpo { var _request = await base.CreatePostRequestAsync(endpoint, args); - if (IsAuthentication == true) + if (IsAuthentication) { var _nonce = GenerateOnlyNonce(16).ToString(); @@ -212,7 +212,7 @@ public override BoolResult GetResponseMessage(RestResponse response = null) _result.SetFailure(errorCode: ErrorCode.NotFoundData); } - if (_result.success == true && response.IsSuccessful == false) + if (_result.success && response.IsSuccessful == false) { _result.SetFailure( response.ErrorMessage ?? response.StatusDescription, diff --git a/src/exchanges/usa/poloniex/private/privateApi.cs b/src/exchanges/usa/poloniex/private/privateApi.cs index 002e1f0..834c34b 100644 --- a/src/exchanges/usa/poloniex/private/privateApi.cs +++ b/src/exchanges/usa/poloniex/private/privateApi.cs @@ -65,7 +65,7 @@ public override async ValueTask
CreateAddressAsync(string currency_name var _result = new Address(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -82,7 +82,7 @@ public override async ValueTask
CreateAddressAsync(string currency_name _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); { @@ -111,7 +111,7 @@ public override async ValueTask FetchAddressesAsync(Dictionary FetchAddressesAsync(Dictionary(_json_value.Content); { @@ -174,7 +174,7 @@ public override async ValueTask CoinWithdrawAsync(string currency_name var _result = new Transfer(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -193,10 +193,10 @@ public override async ValueTask CoinWithdrawAsync(string currency_name _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); - if (_json_data.success == true) + if (_json_data.success) { var _transfer = new PTransferItem { @@ -248,7 +248,7 @@ public override async ValueTask FetchAllTransfersAsync(string timefra var _result = new Transfers(); var _markets = await publicApi.LoadMarketsAsync(); - if (_markets.success == true) + if (_markets.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -272,7 +272,7 @@ public override async ValueTask FetchAllTransfersAsync(string timefra _result.rawJson = _json_value.Content; #endif var _json_result = privateClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = privateClient.DeserializeObject(_json_value.Content); @@ -331,7 +331,7 @@ public override async ValueTask FetchBalancesAsync(Dictionary FetchBalancesAsync(Dictionary>(_json_value.Content); { diff --git a/src/exchanges/usa/poloniex/public/publicApi.cs b/src/exchanges/usa/poloniex/public/publicApi.cs index 6c01be6..f0e130a 100644 --- a/src/exchanges/usa/poloniex/public/publicApi.cs +++ b/src/exchanges/usa/poloniex/public/publicApi.cs @@ -59,7 +59,7 @@ public override async ValueTask FetchMarketsAsync(Dictionary(_json_value.Content); foreach (var _market in _tickers) @@ -140,7 +140,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin var _result = new Ticker(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -156,7 +156,7 @@ public override async ValueTask FetchTickerAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _tickers = publicClient.DeserializeObject>(_json_value.Content); { @@ -189,7 +189,7 @@ public override async ValueTask FetchTickersAsync(Dictionary FetchTickersAsync(Dictionary>(_json_value.Content); { @@ -244,7 +244,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam var _result = new OrderBooks(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -263,7 +263,7 @@ public override async ValueTask FetchOrderBooksAsync(string base_nam _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orderbook = publicClient.DeserializeObject(_json_value.Content); { @@ -301,7 +301,7 @@ public override async ValueTask FetchOHLCVsAsync(string base_name, strin var _result = new OHLCVs(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -328,7 +328,7 @@ public override async ValueTask FetchOHLCVsAsync(string base_name, strin _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject>(_json_value.Content); @@ -374,7 +374,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string var _result = new CompleteOrders(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -407,7 +407,7 @@ public override async ValueTask FetchCompleteOrdersAsync(string _result.rawJson = _json_value.Content; #endif var _json_result = publicClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = publicClient.DeserializeObject>(_json_value.Content); { diff --git a/src/exchanges/usa/poloniex/trade/tradeApi.cs b/src/exchanges/usa/poloniex/trade/tradeApi.cs index 0e56012..554db41 100644 --- a/src/exchanges/usa/poloniex/trade/tradeApi.cs +++ b/src/exchanges/usa/poloniex/trade/tradeApi.cs @@ -67,7 +67,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, var _result = new MyOrders(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -84,7 +84,7 @@ public override async ValueTask FetchOpenOrdersAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _orders = tradeClient.DeserializeObject>(_json_value.Content); { @@ -119,7 +119,7 @@ public override async ValueTask FetchAllOpenOrdersAsync(Dictionary FetchAllOpenOrdersAsync(Dictionary>>(_json_value.Content); { @@ -184,7 +184,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s var _result = new MyTrades(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -207,7 +207,7 @@ public override async ValueTask FetchMyTradesAsync(string base_name, s _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _trades = tradeClient.DeserializeObject>>(_json_value.Content); { @@ -247,7 +247,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -266,7 +266,7 @@ public override async ValueTask CreateLimitOrderAsync(string base_name, _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { @@ -322,7 +322,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Trade); @@ -340,7 +340,7 @@ public override async ValueTask CancelOrderAsync(string base_name, stri _result.rawJson = _json_value.Content; #endif var _json_result = tradeClient.GetResponseMessage(_json_value.Response); - if (_json_result.success == true) + if (_json_result.success) { var _json_data = tradeClient.DeserializeObject(_json_value.Content); { diff --git a/src/shared/numerical.cs b/src/shared/numerical.cs index fb7f0c2..9359736 100644 --- a/src/shared/numerical.cs +++ b/src/shared/numerical.cs @@ -50,7 +50,7 @@ public static bool CompareDecimal(decimal lvalue, decimal rvalue, bool round = t var _r_value = _r_values.Length > 1 ? _r_values[1] : "0"; var _length = _l_value.Length > _r_value.Length ? _r_value.Length : _l_value.Length; - if (round == true) + if (round) { _l_decimal = Decimal.Round(_l_decimal, _length); _r_decimal = Decimal.Round(_r_decimal, _length); diff --git a/src/shared/standard/XApiClient.cs b/src/shared/standard/XApiClient.cs index 4b8ff5b..49ca153 100644 --- a/src/shared/standard/XApiClient.cs +++ b/src/shared/standard/XApiClient.cs @@ -403,7 +403,7 @@ public long GenerateOnlyNonce(int digit_count) { var _nonce = (long)GenerateNonceValue(digit_count); - if (marketLastNonce.ContainsKey(this.DealerName) == true) + if (marketLastNonce.ContainsKey(this.DealerName)) { var _last_nonce = marketLastNonce[this.DealerName]; #if DEBUG @@ -431,7 +431,7 @@ public string ToQueryString(Dictionary args, bool json = false) if (args != null) { - if (json == true) + if (json) { var _params = new List(); foreach (var _entry in args) @@ -490,7 +490,7 @@ public Dictionary MergeParamsAndArgs(Dictionary { foreach (var _arg in args) { - if (@params.ContainsKey(_arg.Key) == true) + if (@params.ContainsKey(_arg.Key)) @params.Remove(_arg.Key); @params.Add(_arg.Key, _arg.Value); @@ -543,12 +543,12 @@ public RestRequest CreateJsonRequest(string resource, Dictionary var _margs = _arg.Value as CArgument; if (_margs != null) { - if (_margs.isArray == true) + if (_margs.isArray) { foreach (var _marg in (_margs.value as Array) ?? new Array[0]) _request.AddParameter(_arg.Key, _marg, ParameterType.GetOrPost); } - else if (_margs.isJson == true) + else if (_margs.isJson) { _request.AddParameter(_arg.Key, JsonConvert.SerializeObject(_margs.value)); } @@ -584,7 +584,7 @@ public virtual Dictionary ErrorMessages /// public virtual string GetErrorMessage(int error_code) { - return ErrorMessages.ContainsKey(error_code) == true + return ErrorMessages.ContainsKey(error_code) ? ErrorMessages[error_code].ToString() : "failure"; } @@ -600,7 +600,7 @@ public virtual BoolResult GetResponseMessage(RestResponse response = null) if (response != null) { - if (response.IsSuccessful == true) + if (response.IsSuccessful) { var _json_result = this.DeserializeObject(response.Content); if (_json_result.SelectToken("message") != null) @@ -612,7 +612,7 @@ public virtual BoolResult GetResponseMessage(RestResponse response = null) } } - if (_result.success == true && response.IsSuccessful == false) + if (_result.success && response.IsSuccessful == false) { _result.SetFailure( response.ErrorMessage ?? response.StatusDescription, @@ -812,7 +812,7 @@ public virtual async ValueTask CreateGetRequestAsync(string endpoin public virtual async ValueTask CallApiGetAsync(string endpoint, Dictionary args = null) where T : new() { var _response = await CallApiGet2Async(endpoint, args); - return _response != null + return _response != null ? this.DeserializeObject(_response.Content) : new T(); } @@ -980,7 +980,7 @@ public virtual async ValueTask CreatePutRequestAsync(string endpoin public virtual async ValueTask CallApiPutAsync(string endpoint, Dictionary args = null) where T : new() { var _response = await CallApiPut2Async(endpoint, args); - return _response != null + return _response != null ? this.DeserializeObject(_response.Content) : new T(); } diff --git a/src/shared/standard/apiResult.cs b/src/shared/standard/apiResult.cs index 083bf01..1fdaaba 100644 --- a/src/shared/standard/apiResult.cs +++ b/src/shared/standard/apiResult.cs @@ -61,7 +61,7 @@ public class ApiResult : IApiResult /// public ApiResult(bool success = false) { - if (success == true) + if (success) this.SetSuccess(); else this.SetFailure(); diff --git a/src/shared/standard/exchangeInfo.cs b/src/shared/standard/exchangeInfo.cs index 4cc99bc..c5f3794 100644 --- a/src/shared/standard/exchangeInfo.cs +++ b/src/shared/standard/exchangeInfo.cs @@ -289,7 +289,7 @@ public Dictionary MergeCurrencyCode(Dictionary c var _key = _currency_id.Key.ToUpper(); var _value = _currency_id.Value.ToUpper(); - if (this.CurrencyIds.ContainsKey(_key) == true) + if (this.CurrencyIds.ContainsKey(_key)) this.CurrencyIds[_key] = _value; else this.CurrencyIds.Add(_key, _value); @@ -349,7 +349,7 @@ public Dictionary MergeTimeframe(Dictionary time { foreach (var _timeframe in timeframes) { - if (this.Timeframes.ContainsKey(_timeframe.Key) == true) + if (this.Timeframes.ContainsKey(_timeframe.Key)) this.Timeframes[_timeframe.Key] = _timeframe.Value; else this.Timeframes.Add(_timeframe.Key, _timeframe.Value); @@ -365,7 +365,7 @@ public Dictionary MergeTimeframe(Dictionary time /// public string GetTimeframe(string timeframe) { - return (Timeframes.ContainsKey(timeframe) == true) + return (Timeframes.ContainsKey(timeframe)) ? ((String.IsNullOrEmpty(Timeframes[timeframe]) == false) ? Timeframes[timeframe] : timeframe) : timeframe; } @@ -379,7 +379,7 @@ public string GetApiUrl(string division) { var _result = this.Urls.api.FirstOrDefault().Value; - if (this.Urls.api.ContainsKey(division) == true) + if (this.Urls.api.ContainsKey(division)) _result = this.Urls.api[division]; return _result; @@ -395,7 +395,7 @@ public decimal GetAmountMultiplier(string currency_name, decimal value = 1.0m) { var _result = value; - if (this.AmountMultiplier.ContainsKey(currency_name) == true) + if (this.AmountMultiplier.ContainsKey(currency_name)) _result = this.AmountMultiplier[currency_name]; return _result; diff --git a/src/shared/standard/nameResult.cs b/src/shared/standard/nameResult.cs index 3a356ea..40b9afd 100644 --- a/src/shared/standard/nameResult.cs +++ b/src/shared/standard/nameResult.cs @@ -31,7 +31,7 @@ public class NameResult : ApiResult, INameResult /// public NameResult(bool success = true) { - if (success == true) + if (success) this.SetSuccess(); else this.SetFailure(); @@ -69,7 +69,7 @@ public class BoolResult : ApiResult, IBoolResult /// public BoolResult(bool success = true) { - if (success == true) + if (success) { this.SetSuccess(); this.result = true; diff --git a/src/shared/standard/private/privateApi.cs b/src/shared/standard/private/privateApi.cs index 4046de3..c861644 100644 --- a/src/shared/standard/private/privateApi.cs +++ b/src/shared/standard/private/privateApi.cs @@ -180,7 +180,7 @@ public virtual async ValueTask
CreateAddressAsync(string currency_name, var _result = new Address(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -208,7 +208,7 @@ public virtual async ValueTask
FetchAddressAsync(string currency_name, var _result = new Address(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -235,7 +235,7 @@ public virtual async ValueTask FetchAddressesAsync(Dictionary CoinWithdrawAsync(string currency_name, var _result = new Transfer(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -295,7 +295,7 @@ public virtual async ValueTask CancelCoinWithdrawAsync(string currency var _result = new Transfer(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -326,7 +326,7 @@ public virtual async ValueTask FiatWithdrawAsync(string currency_name, var _result = new Transfer(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -355,7 +355,7 @@ public virtual async ValueTask FetchTransferAsync(string currency_name var _result = new Transfer(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -386,7 +386,7 @@ public virtual async ValueTask FetchTransfersAsync(string currency_na var _result = new Transfers(); var _currency_id = await publicApi.LoadCurrencyIdAsync(currency_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -419,7 +419,7 @@ public virtual async ValueTask FetchAllTransfersAsync(string timefram var _result = new Transfers(); var _markets = await publicApi.LoadMarketsAsync(); - if (_markets.success == true) + if (_markets.success) { var _timestamp = privateClient.ExchangeInfo.GetTimestamp(timeframe); var _timeframe = privateClient.ExchangeInfo.GetTimeframe(timeframe); @@ -451,7 +451,7 @@ public virtual async ValueTask FetchWalletAsync(string base_name, string var _result = new Wallet(); var _currency_id = await publicApi.LoadCurrencyIdAsync(base_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -479,7 +479,7 @@ public virtual async ValueTask FetchWalletsAsync(string user_id, Dictio var _result = new Wallets(); var _markets = await publicApi.LoadMarketsAsync(); - if (_markets.success == true) + if (_markets.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -508,7 +508,7 @@ public virtual async ValueTask FetchBalanceAsync(string base_name, stri var _result = new Balance(); var _currency_id = await publicApi.LoadCurrencyIdAsync(base_name); - if (_currency_id.success == true) + if (_currency_id.success) { privateClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -536,7 +536,7 @@ public virtual async ValueTask FetchBalancesAsync(Dictionary LoadMarketsAsync(bool reload = false, Di { if (publicClient.ExchangeInfo.Markets == null) { - if (marketPool.ContainsKey(publicClient.DealerName) == true) + if (marketPool.ContainsKey(publicClient.DealerName)) publicClient.ExchangeInfo.Markets = marketPool[publicClient.DealerName] as Markets ?? new Markets(); } - if (publicClient.ExchangeInfo.Markets == null || reload == true) + if (publicClient.ExchangeInfo.Markets == null || reload) { var _markets = await FetchMarketsAsync(args); if (_markets.success == false) @@ -196,9 +196,9 @@ public virtual async ValueTask LoadMarketAsync(string marketId, Dictiona var _result = new Market(marketId); var _markets = await this.LoadMarketsAsync(); - if (_markets.success == true) + if (_markets.success) { - if (_markets.result.ContainsKey(marketId) == true) + if (_markets.result.ContainsKey(marketId)) { _result.result = _markets.result[marketId]; @@ -231,9 +231,9 @@ public virtual async ValueTask LoadCurrencyIdAsync(string currency_n var _result = new NameResult(); var _markets = await this.LoadMarketsAsync(); - if (_markets.success == true) + if (_markets.success) { - if (_markets.CurrencyNames.ContainsValue(currency_name) == true) + if (_markets.CurrencyNames.ContainsValue(currency_name)) { _result.result = _markets.GetCurrencyId(currency_name); @@ -266,9 +266,9 @@ public virtual async ValueTask LoadCurrencyNickAsync(string currency var _result = new NameResult(); var _markets = await this.LoadMarketsAsync(); - if (_markets.success == true) + if (_markets.success) { - if (publicClient.ExchangeInfo.CurrencyNicks.ContainsKey(currency_name) == true) + if (publicClient.ExchangeInfo.CurrencyNicks.ContainsKey(currency_name)) { _result.result = publicClient.ExchangeInfo.CurrencyNicks[currency_name]; _result.SetResult(_markets); @@ -319,7 +319,7 @@ public virtual async ValueTask FetchTickerAsync(string base_name, string var _result = new Ticker(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId ?? ""); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -346,7 +346,7 @@ public virtual async ValueTask FetchTickersAsync(Dictionary FetchOrderBooksAsync(string base_name if (_result.marketId != null) { var _market = await this.LoadMarketAsync(_result.marketId ?? ""); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -411,7 +411,7 @@ public virtual async ValueTask FetchOHLCVsAsync(string base_name, string var _result = new OHLCVs(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId ?? ""); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); @@ -446,7 +446,7 @@ public virtual async ValueTask FetchCompleteOrdersAsync(string b var _result = new CompleteOrders(base_name, quote_name); var _market = await this.LoadMarketAsync(_result.marketId ?? ""); - if (_market.success == true) + if (_market.success) { publicClient.ExchangeInfo.ApiCallWait(TradeType.Public); diff --git a/src/shared/standard/trade/tradeApi.cs b/src/shared/standard/trade/tradeApi.cs index 8ea462a..c4af100 100644 --- a/src/shared/standard/trade/tradeApi.cs +++ b/src/shared/standard/trade/tradeApi.cs @@ -229,7 +229,7 @@ public virtual async ValueTask FetchMyOrderAsync(string base_name, stri var _result = new MyOrder(base_name, quote_name); var _currency_id = await publicApi.LoadCurrencyIdAsync(base_name); - if (_currency_id.success == true) + if (_currency_id.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -261,7 +261,7 @@ public virtual async ValueTask FetchMyOrdersAsync(string base_name, st var _result = new MyOrders(base_name, quote_name); var _currency_id = await publicApi.LoadCurrencyIdAsync(base_name); - if (_currency_id.success == true) + if (_currency_id.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -293,7 +293,7 @@ public virtual async ValueTask FetchOpenOrdersAsync(string base_name, var _result = new MyOrders(base_name, quote_name); var _currency_id = await publicApi.LoadCurrencyIdAsync(base_name); - if (_currency_id.success == true) + if (_currency_id.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -320,7 +320,7 @@ public virtual async ValueTask FetchAllOpenOrdersAsync(Dictionary FetchOpenPositionsAsync(string base_ var _result = new MyPositions(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId ?? ""); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -376,7 +376,7 @@ public virtual async ValueTask FetchAllOpenPositionsAsync(Dictionar var _result = new MyPositions(); var _markets = await publicApi.LoadMarketsAsync(); - if (_markets.success == true) + if (_markets.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -408,7 +408,7 @@ public virtual async ValueTask FetchMyTradesAsync(string base_name, st var _result = new MyTrades(base_name, quote_name); var _currency_id = await publicApi.LoadCurrencyIdAsync(base_name); - if (_currency_id.success == true) + if (_currency_id.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -443,7 +443,7 @@ public virtual async ValueTask CreateOrderAsync(string base_name, strin var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId ?? ""); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -484,7 +484,7 @@ public virtual async ValueTask CreateLimitOrderAsync(string base_name, var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId ?? ""); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -525,7 +525,7 @@ public virtual async ValueTask CreateMarketOrderAsync(string base_name, var _result = new MyOrder(base_name, quote_name); var _market = await publicApi.LoadMarketAsync(_result.marketId ?? ""); - if (_market.success == true) + if (_market.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -567,7 +567,7 @@ public virtual async ValueTask CancelOrderAsync(string base_name, strin var _result = new MyOrder(base_name, quote_name); var _currency_id = await publicApi.LoadCurrencyIdAsync(base_name); - if (_currency_id.success == true) + if (_currency_id.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -604,7 +604,7 @@ public virtual async ValueTask CancelOrdersAsync(string base_name, str var _result = new MyOrders(base_name, quote_name); var _currency_id = await publicApi.LoadCurrencyIdAsync(base_name); - if (_currency_id.success == true) + if (_currency_id.success) { tradeClient.ExchangeInfo.ApiCallWait(TradeType.Private); @@ -631,7 +631,7 @@ public virtual async ValueTask CancelAllOrdersAsync(Dictionary - net6.0 false ccxt.test CCXT.TEST diff --git a/tests/ccxt.test/private/bithumb.cs b/tests/ccxt.test/private/bithumb.cs index dbf9c75..96deb47 100644 --- a/tests/ccxt.test/private/bithumb.cs +++ b/tests/ccxt.test/private/bithumb.cs @@ -2,6 +2,7 @@ using CCXT.NET.Shared.Converter; using System; using System.Collections.Generic; +using System.Threading.Tasks; using Xunit; namespace XUnit @@ -9,7 +10,7 @@ namespace XUnit public partial class PrivateApi { [Fact] - public async void Bithumb() + public async Task Bithumb() { var _api_key = TestConfig.GetConnectionKey("Bithumb"); var _args = new Dictionary(); @@ -27,7 +28,7 @@ public async void Bithumb() #endif var _new_address = await _private_api.CreateAddressAsync("XRP", GetJsonContent(_private_api.privateClient, "createAddress", _args)); - if (_new_address.supported == true || TestConfig.SupportedCheck == true) + if (_new_address.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _new_address); @@ -39,7 +40,7 @@ public async void Bithumb() } var _address = await _private_api.FetchAddressAsync("BTC", GetJsonContent(_private_api.privateClient, "fetchAddress", _args)); - if (_address.supported == true || TestConfig.SupportedCheck == true) + if (_address.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _address); @@ -52,7 +53,7 @@ public async void Bithumb() } var _addresses = await _private_api.FetchAddressesAsync(GetJsonContent(_private_api.privateClient, "fetchAddresses", _args)); - if (_addresses.supported == true || TestConfig.SupportedCheck == true) + if (_addresses.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _addresses); @@ -71,7 +72,7 @@ public async void Bithumb() if (XApiClient.TestXUnitMode != XUnitMode.UseExchangeServer) { var _withdraw = await _private_api.CoinWithdrawAsync("XRP", "rN9qNpgnBaZwqCg8CvUZRPqCcPPY7wfWep", "3162679978", 10.0m, GetJsonContent(_private_api.privateClient, "coinWithdraw", _args)); - if ((_withdraw.supported == true || TestConfig.SupportedCheck == true) && _withdraw.statusCode != 5600) + if ((_withdraw.supported || TestConfig.SupportedCheck) && _withdraw.statusCode != 5600) { this.WriteJson(_private_api.privateClient, _withdraw); @@ -81,11 +82,11 @@ public async void Bithumb() Assert.False(String.IsNullOrEmpty(_withdraw.result.transferId)); } - if (String.IsNullOrEmpty(_withdraw.result.transferId) == true) + if (String.IsNullOrEmpty(_withdraw.result.transferId)) _withdraw.result.transferId = _private_api.privateClient.GenerateNonceString(13); var _cancel_withdraw = await _private_api.CancelCoinWithdrawAsync("XRP", _withdraw.result.transferId, GetJsonContent(_private_api.privateClient, "cancelCoinWithdraw", _args)); - if (_cancel_withdraw.supported == true || TestConfig.SupportedCheck == true) + if (_cancel_withdraw.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _cancel_withdraw); @@ -97,7 +98,7 @@ public async void Bithumb() } #endif var _fetch_transfers = await _private_api.FetchTransfersAsync("XRP", _timeframe, _since, _limit, GetJsonContent(_private_api.privateClient, "fetchTransfers", _args)); - if (_fetch_transfers.supported == true || TestConfig.SupportedCheck == true) + if (_fetch_transfers.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _fetch_transfers); @@ -121,7 +122,7 @@ public async void Bithumb() _transfer_id = Guid.NewGuid().ToString(); var _fetch_transfer = await _private_api.FetchTransferAsync("XRP", _transfer_id, GetJsonContent(_private_api.privateClient, "fetchTransfer", _args)); - if (_fetch_transfer.supported == true || TestConfig.SupportedCheck == true) + if (_fetch_transfer.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _fetch_transfer); @@ -136,7 +137,7 @@ public async void Bithumb() } var _fetch_all_transfers = await _private_api.FetchAllTransfersAsync(_timeframe, _since, _limit, GetJsonContent(_private_api.privateClient, "fetchAllTransfers", _args)); - if (_fetch_all_transfers.supported == true || TestConfig.SupportedCheck == true) + if (_fetch_all_transfers.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _fetch_all_transfers); @@ -154,7 +155,7 @@ public async void Bithumb() } var _balance = await _private_api.FetchBalanceAsync("BTC", "KRW", GetJsonContent(_private_api.privateClient, "fetchBalance", _args)); - if (_balance.supported == true || TestConfig.SupportedCheck == true) + if (_balance.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _balance); @@ -167,7 +168,7 @@ public async void Bithumb() } var _balances = await _private_api.FetchBalancesAsync(GetJsonContent(_private_api.privateClient, "fetchBalances", _args)); - if (_balances.supported == true || TestConfig.SupportedCheck == true) + if (_balances.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _balances); @@ -183,7 +184,7 @@ public async void Bithumb() } var _wallet = await _private_api.FetchWalletAsync("XRP", "KRW", GetJsonContent(_private_api.privateClient, "fetchWallet", _args)); - if (_wallet.supported == true || TestConfig.SupportedCheck == true) + if (_wallet.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _wallet); @@ -196,7 +197,7 @@ public async void Bithumb() } var _wallets = await _private_api.FetchWalletsAsync(_api_key.user_id, GetJsonContent(_private_api.privateClient, "fetchWallets", _args)); - if (_wallets.supported == true || TestConfig.SupportedCheck == true) + if (_wallets.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _wallets); diff --git a/tests/ccxt.test/private/bitmex.cs b/tests/ccxt.test/private/bitmex.cs index 699e281..f004383 100644 --- a/tests/ccxt.test/private/bitmex.cs +++ b/tests/ccxt.test/private/bitmex.cs @@ -2,6 +2,7 @@ using CCXT.NET.Shared.Converter; using System; using System.Collections.Generic; +using System.Threading.Tasks; using Xunit; namespace XUnit @@ -9,7 +10,7 @@ namespace XUnit public partial class PrivateApi { [Fact] - public async void BitMEX() + public async Task BitMEX() { var _api_key = TestConfig.GetConnectionKey("BitMEX"); var _args = new Dictionary(); @@ -27,7 +28,7 @@ public async void BitMEX() #endif var _new_address = await _private_api.CreateAddressAsync("BTC", GetJsonContent(_private_api.privateClient, "createAddress", _args)); - if (_new_address.supported == true || TestConfig.SupportedCheck == true) + if (_new_address.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _new_address); @@ -39,7 +40,7 @@ public async void BitMEX() } var _address = await _private_api.FetchAddressAsync("BTC", GetJsonContent(_private_api.privateClient, "fetchAddress", _args)); - if (_address.supported == true || TestConfig.SupportedCheck == true) + if (_address.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _address); @@ -52,7 +53,7 @@ public async void BitMEX() } var _addresses = await _private_api.FetchAddressesAsync(GetJsonContent(_private_api.privateClient, "fetchAddresses", _args)); - if (_addresses.supported == true || TestConfig.SupportedCheck == true) + if (_addresses.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _addresses); @@ -71,7 +72,7 @@ public async void BitMEX() if (XApiClient.TestXUnitMode != XUnitMode.UseExchangeServer) { var _withdraw = await _private_api.CoinWithdrawAsync("BTC", "3DE2DBYHC6dj2DZSEDamwnXffzyNHuAr6v", "", 0.1m, GetJsonContent(_private_api.privateClient, "coinWithdraw", _args)); - if ((_withdraw.supported == true || TestConfig.SupportedCheck == true) && _withdraw.message.IndexOf("amount is invalid") < 0) + if ((_withdraw.supported || TestConfig.SupportedCheck) && _withdraw.message.IndexOf("amount is invalid") < 0) { this.WriteJson(_private_api.privateClient, _withdraw); @@ -81,11 +82,11 @@ public async void BitMEX() Assert.False(String.IsNullOrEmpty(_withdraw.result.transferId)); } - if (String.IsNullOrEmpty(_withdraw.result.transferId) == true) + if (String.IsNullOrEmpty(_withdraw.result.transferId)) _withdraw.result.transferId = _private_api.privateClient.GenerateNonceString(13); var _cancel_withdraw = await _private_api.CancelCoinWithdrawAsync("BTC", _withdraw.result.transferId, GetJsonContent(_private_api.privateClient, "cancelCoinWithdraw", _args)); - if (_cancel_withdraw.supported == true || TestConfig.SupportedCheck == true) + if (_cancel_withdraw.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _cancel_withdraw); @@ -97,7 +98,7 @@ public async void BitMEX() } #endif var _fetch_transfers = await _private_api.FetchTransfersAsync("BTC", _timeframe, _since, _limit, GetJsonContent(_private_api.privateClient, "fetchTransfers", _args)); - if ((_fetch_transfers.supported == true || TestConfig.SupportedCheck == true) && _fetch_transfers.errorCode != ErrorCode.OrderNotFound) + if ((_fetch_transfers.supported || TestConfig.SupportedCheck) && _fetch_transfers.errorCode != ErrorCode.OrderNotFound) { this.WriteJson(_private_api.privateClient, _fetch_transfers); @@ -121,7 +122,7 @@ public async void BitMEX() _transfer_id = Guid.NewGuid().ToString(); var _fetch_transfer = await _private_api.FetchTransferAsync("BTC", _transfer_id, GetJsonContent(_private_api.privateClient, "fetchTransfer", _args)); - if (_fetch_transfer.supported == true || TestConfig.SupportedCheck == true) + if (_fetch_transfer.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _fetch_transfer); @@ -136,7 +137,7 @@ public async void BitMEX() } var _fetch_all_transfers = await _private_api.FetchAllTransfersAsync(_timeframe, _since, _limit, GetJsonContent(_private_api.privateClient, "fetchAllTransfers", _args)); - if (_fetch_all_transfers.supported == true || TestConfig.SupportedCheck == true) + if (_fetch_all_transfers.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _fetch_all_transfers); @@ -154,7 +155,7 @@ public async void BitMEX() } var _balance = await _private_api.FetchBalanceAsync("BTC", "USD", GetJsonContent(_private_api.privateClient, "fetchBalance", _args)); - if (_balance.supported == true || TestConfig.SupportedCheck == true) + if (_balance.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _balance); @@ -167,7 +168,7 @@ public async void BitMEX() } var _balances = await _private_api.FetchBalancesAsync(GetJsonContent(_private_api.privateClient, "fetchBalances", _args)); - if (_balances.supported == true || TestConfig.SupportedCheck == true) + if (_balances.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _balances); @@ -183,7 +184,7 @@ public async void BitMEX() } var _wallet = await _private_api.FetchWalletAsync("BTC", "USD", GetJsonContent(_private_api.privateClient, "fetchWallet", _args)); - if (_wallet.supported == true || TestConfig.SupportedCheck == true) + if (_wallet.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _wallet); @@ -196,7 +197,7 @@ public async void BitMEX() } var _wallets = await _private_api.FetchWalletsAsync(_api_key.user_id, GetJsonContent(_private_api.privateClient, "fetchWallets", _args)); - if (_wallets.supported == true || TestConfig.SupportedCheck == true) + if (_wallets.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _wallets); diff --git a/tests/ccxt.test/private/coinone.cs b/tests/ccxt.test/private/coinone.cs index 7e7de5c..79909ad 100644 --- a/tests/ccxt.test/private/coinone.cs +++ b/tests/ccxt.test/private/coinone.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Threading.Tasks; using Xunit; namespace XUnit @@ -10,7 +11,7 @@ namespace XUnit public partial class PrivateApi { [Fact] - public async void Coinone() + public async Task Coinone() { var _api_key = TestConfig.GetConnectionKey("Coinone"); var _args = new Dictionary(); @@ -28,7 +29,7 @@ public async void Coinone() #endif var _new_address = await _private_api.CreateAddressAsync("XRP", GetJsonContent(_private_api.privateClient, "createAddress", _args)); - if (_new_address.supported == true || TestConfig.SupportedCheck == true) + if (_new_address.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _new_address); @@ -40,7 +41,7 @@ public async void Coinone() } var _address = await _private_api.FetchAddressAsync("XRP", GetJsonContent(_private_api.privateClient, "fetchAddress", _args)); - if (_address.supported == true || TestConfig.SupportedCheck == true) + if (_address.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _address); @@ -53,7 +54,7 @@ public async void Coinone() } var _addresses = await _private_api.FetchAddressesAsync(GetJsonContent(_private_api.privateClient, "fetchAddresses", _args)); - if (_addresses.supported == true || TestConfig.SupportedCheck == true) + if (_addresses.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _addresses); @@ -73,8 +74,8 @@ public async void Coinone() { _args.Clear(); { - // auth_number SMS ߼ , Էص ۵ - // ſ google OTP number Էϸ "request time-out error" ߻ + // auth_number�� SMS�� �߼� ������, �Է��ص� �۵� ���� ���� + // ��ſ� google OTP number�� �Է��ϸ� ������ ������ "request time-out error" �߻� var _auth_number = await _private_api.GetAuthNumberAsync("BTC", _args); _args.Add("auth_number", _auth_number.result); @@ -82,7 +83,7 @@ public async void Coinone() } var _withdraw = await _private_api.CoinWithdrawAsync("BTC", "3DE2DBYHC6dj2DZSEDamwnXffzyNHuAr6v", "", 0.01m, GetJsonContent(_private_api.privateClient, "coinWithdraw", _args)); - if ((_withdraw.supported == true || TestConfig.SupportedCheck == true) && _withdraw.statusCode != 777 && _withdraw.statusCode != 103) + if ((_withdraw.supported || TestConfig.SupportedCheck) && _withdraw.statusCode != 777 && _withdraw.statusCode != 103) { this.WriteJson(_private_api.privateClient, _withdraw); @@ -92,11 +93,11 @@ public async void Coinone() Assert.False(String.IsNullOrEmpty(_withdraw.result.transferId)); } - if (String.IsNullOrEmpty(_withdraw.result.transferId) == true) + if (String.IsNullOrEmpty(_withdraw.result.transferId)) _withdraw.result.transferId = _private_api.privateClient.GenerateNonceString(13); var _cancel_withdraw = await _private_api.CancelCoinWithdrawAsync("XRP", _withdraw.result.transferId, GetJsonContent(_private_api.privateClient, "cancelCoinWithdraw", _args)); - if (_cancel_withdraw.supported == true || TestConfig.SupportedCheck == true) + if (_cancel_withdraw.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _cancel_withdraw); @@ -108,7 +109,7 @@ public async void Coinone() } #endif var _fetch_transfers = await _private_api.FetchTransfersAsync("XRP", _timeframe, _since, _limit, GetJsonContent(_private_api.privateClient, "fetchTransfers", _args)); - if (_fetch_transfers.supported == true || TestConfig.SupportedCheck == true) + if (_fetch_transfers.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _fetch_transfers); @@ -132,7 +133,7 @@ public async void Coinone() _transfer_id = Guid.NewGuid().ToString(); var _fetch_transfer = await _private_api.FetchTransferAsync("XRP", _transfer_id, GetJsonContent(_private_api.privateClient, "fetchTransfer", _args)); - if (_fetch_transfer.supported == true || TestConfig.SupportedCheck == true) + if (_fetch_transfer.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _fetch_transfer); @@ -147,7 +148,7 @@ public async void Coinone() } var _fetch_all_transfers = await _private_api.FetchAllTransfersAsync(_timeframe, _since, _limit, GetJsonContent(_private_api.privateClient, "fetchAllTransfers", _args)); - if (_fetch_all_transfers.supported == true || TestConfig.SupportedCheck == true) + if (_fetch_all_transfers.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _fetch_all_transfers); @@ -165,7 +166,7 @@ public async void Coinone() } var _balance = await _private_api.FetchBalanceAsync("XRP", "", GetJsonContent(_private_api.privateClient, "fetchBalance", _args)); - if (_balance.supported == true || TestConfig.SupportedCheck == true) + if (_balance.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _balance); @@ -178,7 +179,7 @@ public async void Coinone() } var _balances = await _private_api.FetchBalancesAsync(GetJsonContent(_private_api.privateClient, "fetchBalances", _args)); - if (_balances.supported == true || TestConfig.SupportedCheck == true) + if (_balances.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _balances); @@ -194,7 +195,7 @@ public async void Coinone() } var _wallet = await _private_api.FetchWalletAsync("XRP", "USD", GetJsonContent(_private_api.privateClient, "fetchWallet", _args)); - if (_wallet.supported == true || TestConfig.SupportedCheck == true) + if (_wallet.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _wallet); @@ -207,7 +208,7 @@ public async void Coinone() } var _wallets = await _private_api.FetchWalletsAsync(_api_key.user_id, GetJsonContent(_private_api.privateClient, "fetchWallets", _args)); - if (_wallets.supported == true || TestConfig.SupportedCheck == true) + if (_wallets.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _wallets); diff --git a/tests/ccxt.test/private/korbit.cs b/tests/ccxt.test/private/korbit.cs index 49017f3..d83104c 100644 --- a/tests/ccxt.test/private/korbit.cs +++ b/tests/ccxt.test/private/korbit.cs @@ -2,6 +2,7 @@ using CCXT.NET.Shared.Converter; using System; using System.Collections.Generic; +using System.Threading.Tasks; using Xunit; namespace XUnit @@ -9,7 +10,7 @@ namespace XUnit public partial class PrivateApi { [Fact] - public async void Korbit() + public async Task Korbit() { var _api_key = TestConfig.GetConnectionKey("Korbit"); var _args = new Dictionary(); @@ -27,7 +28,7 @@ public async void Korbit() #endif var _new_address = await _private_api.CreateAddressAsync("XRP", GetJsonContent(_private_api.privateClient, "createAddress", _args)); - if ((_new_address.supported == true || TestConfig.SupportedCheck == true) && _new_address.message.IndexOf("assign address not allowed") < 0) + if ((_new_address.supported || TestConfig.SupportedCheck) && _new_address.message.IndexOf("assign address not allowed") < 0) { this.WriteJson(_private_api.privateClient, _new_address); @@ -39,7 +40,7 @@ public async void Korbit() } var _address = await _private_api.FetchAddressAsync("XRP", GetJsonContent(_private_api.privateClient, "fetchAddress", _args)); - if (_address.supported == true || TestConfig.SupportedCheck == true) + if (_address.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _address); @@ -52,7 +53,7 @@ public async void Korbit() } var _addresses = await _private_api.FetchAddressesAsync(GetJsonContent(_private_api.privateClient, "fetchAddresses", _args)); - if (_addresses.supported == true || TestConfig.SupportedCheck == true) + if (_addresses.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _addresses); @@ -71,7 +72,7 @@ public async void Korbit() if (XApiClient.TestXUnitMode != XUnitMode.UseExchangeServer) { var _withdraw = await _private_api.CoinWithdrawAsync("XRP", "rN9qNpgnBaZwqCg8CvUZRPqCcPPY7wfWep", "3162679978", 10.0m, GetJsonContent(_private_api.privateClient, "coinWithdraw", _args)); - if ((_withdraw.supported == true || TestConfig.SupportedCheck == true) && _withdraw.statusCode != 400) + if ((_withdraw.supported || TestConfig.SupportedCheck) && _withdraw.statusCode != 400) { this.WriteJson(_private_api.privateClient, _withdraw); @@ -81,11 +82,11 @@ public async void Korbit() Assert.False(String.IsNullOrEmpty(_withdraw.result.transferId)); } - if (String.IsNullOrEmpty(_withdraw.result.transferId) == true) + if (String.IsNullOrEmpty(_withdraw.result.transferId)) _withdraw.result.transferId = _private_api.privateClient.GenerateNonceString(13); var _cancel_withdraw = await _private_api.CancelCoinWithdrawAsync("XRP", _withdraw.result.transferId, GetJsonContent(_private_api.privateClient, "cancelCoinWithdraw", _args)); - if ((_cancel_withdraw.supported == true || TestConfig.SupportedCheck == true) && _cancel_withdraw.message.IndexOf("not_found") < 0) + if ((_cancel_withdraw.supported || TestConfig.SupportedCheck) && _cancel_withdraw.message.IndexOf("not_found") < 0) { this.WriteJson(_private_api.privateClient, _cancel_withdraw); @@ -97,7 +98,7 @@ public async void Korbit() } #endif var _fetch_transfers = await _private_api.FetchTransfersAsync("XRP", _timeframe, _since, _limit, GetJsonContent(_private_api.privateClient, "fetchTransfers", _args)); - if (_fetch_transfers.supported == true || TestConfig.SupportedCheck == true) + if (_fetch_transfers.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _fetch_transfers); @@ -121,7 +122,7 @@ public async void Korbit() _transfer_id = Guid.NewGuid().ToString(); var _fetch_transfer = await _private_api.FetchTransferAsync("XRP", _transfer_id, GetJsonContent(_private_api.privateClient, "fetchTransfer", _args)); - if (_fetch_transfer.supported == true || TestConfig.SupportedCheck == true) + if (_fetch_transfer.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _fetch_transfer); @@ -136,7 +137,7 @@ public async void Korbit() } var _fetch_all_transfers = await _private_api.FetchAllTransfersAsync(_timeframe, _since, _limit, GetJsonContent(_private_api.privateClient, "fetchAllTransfers", _args)); - if (_fetch_all_transfers.supported == true || TestConfig.SupportedCheck == true) + if (_fetch_all_transfers.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _fetch_all_transfers); @@ -154,7 +155,7 @@ public async void Korbit() } var _balance = await _private_api.FetchBalanceAsync("XRP", "", GetJsonContent(_private_api.privateClient, "fetchBalance", _args)); - if (_balance.supported == true || TestConfig.SupportedCheck == true) + if (_balance.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _balance); @@ -167,7 +168,7 @@ public async void Korbit() } var _balances = await _private_api.FetchBalancesAsync(GetJsonContent(_private_api.privateClient, "fetchBalances", _args)); - if (_balances.supported == true || TestConfig.SupportedCheck == true) + if (_balances.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _balances); @@ -183,7 +184,7 @@ public async void Korbit() } var _wallet = await _private_api.FetchWalletAsync("XRP", "USD", GetJsonContent(_private_api.privateClient, "fetchWallet", _args)); - if (_wallet.supported == true || TestConfig.SupportedCheck == true) + if (_wallet.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _wallet); @@ -196,7 +197,7 @@ public async void Korbit() } var _wallets = await _private_api.FetchWalletsAsync(_api_key.user_id, GetJsonContent(_private_api.privateClient, "fetchWallets", _args)); - if (_wallets.supported == true || TestConfig.SupportedCheck == true) + if (_wallets.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _wallets); diff --git a/tests/ccxt.test/private/poloniex.cs b/tests/ccxt.test/private/poloniex.cs index f94b071..a5be39f 100644 --- a/tests/ccxt.test/private/poloniex.cs +++ b/tests/ccxt.test/private/poloniex.cs @@ -2,6 +2,7 @@ using CCXT.NET.Shared.Converter; using System; using System.Collections.Generic; +using System.Threading.Tasks; using Xunit; namespace XUnit @@ -9,7 +10,7 @@ namespace XUnit public partial class PrivateApi { [Fact] - public async void Poloniex() + public async Task Poloniex() { var _api_key = TestConfig.GetConnectionKey("Poloniex"); @@ -28,7 +29,7 @@ public async void Poloniex() #endif var _new_address = await _private_api.CreateAddressAsync("XRP", GetJsonContent(_private_api.privateClient, "createAddress", _args)); - if ((_new_address.supported == true || TestConfig.SupportedCheck == true) && _new_address.message.IndexOf("You may only") < 0) + if ((_new_address.supported || TestConfig.SupportedCheck) && _new_address.message.IndexOf("You may only") < 0) { this.WriteJson(_private_api.privateClient, _new_address); @@ -40,7 +41,7 @@ public async void Poloniex() } var _address = await _private_api.FetchAddressAsync("BTC", GetJsonContent(_private_api.privateClient, "fetchAddress", _args)); - if (_address.supported == true || TestConfig.SupportedCheck == true) + if (_address.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _address); @@ -53,7 +54,7 @@ public async void Poloniex() } var _addresses = await _private_api.FetchAddressesAsync(GetJsonContent(_private_api.privateClient, "fetchAddresses", _args)); - if (_addresses.supported == true || TestConfig.SupportedCheck == true) + if (_addresses.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _addresses); @@ -72,7 +73,7 @@ public async void Poloniex() if (XApiClient.TestXUnitMode != XUnitMode.UseExchangeServer) { var _withdraw = await _private_api.CoinWithdrawAsync("ETH", "0xad8f564dcf5cc7e7e60db938b01283a4da208602", "", 0.1m, GetJsonContent(_private_api.privateClient, "coinWithdraw", _args)); - if ((_withdraw.supported == true || TestConfig.SupportedCheck == true) && _withdraw.message.IndexOf("Not enough") < 0) + if ((_withdraw.supported || TestConfig.SupportedCheck) && _withdraw.message.IndexOf("Not enough") < 0) { this.WriteJson(_private_api.privateClient, _withdraw); @@ -82,11 +83,11 @@ public async void Poloniex() Assert.False(String.IsNullOrEmpty(_withdraw.result.transferId)); } - if (String.IsNullOrEmpty(_withdraw.result.transferId) == true) + if (String.IsNullOrEmpty(_withdraw.result.transferId)) _withdraw.result.transferId = _private_api.privateClient.GenerateNonceString(13); var _cancel_withdraw = await _private_api.CancelCoinWithdrawAsync("BTC", _withdraw.result.transferId, GetJsonContent(_private_api.privateClient, "cancelCoinWithdraw", _args)); - if (_cancel_withdraw.supported == true || TestConfig.SupportedCheck == true) + if (_cancel_withdraw.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _cancel_withdraw); @@ -98,7 +99,7 @@ public async void Poloniex() } #endif var _fetch_transfers = await _private_api.FetchTransfersAsync("BTC", _timeframe, _since, _limit, GetJsonContent(_private_api.privateClient, "fetchTransfers", _args)); - if (_fetch_transfers.supported == true || TestConfig.SupportedCheck == true) + if (_fetch_transfers.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _fetch_transfers); @@ -122,7 +123,7 @@ public async void Poloniex() _transfer_id = Guid.NewGuid().ToString(); var _fetch_transfer = await _private_api.FetchTransferAsync("XRP", _transfer_id, GetJsonContent(_private_api.privateClient, "fetchTransfer", _args)); - if (_fetch_transfer.supported == true || TestConfig.SupportedCheck == true) + if (_fetch_transfer.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _fetch_transfer); @@ -137,7 +138,7 @@ public async void Poloniex() } var _fetch_all_transfers = await _private_api.FetchAllTransfersAsync(_timeframe, _since, _limit, GetJsonContent(_private_api.privateClient, "fetchAllTransfers", _args)); - if (_fetch_all_transfers.supported == true || TestConfig.SupportedCheck == true) + if (_fetch_all_transfers.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _fetch_all_transfers); @@ -155,7 +156,7 @@ public async void Poloniex() } var _balance = await _private_api.FetchBalanceAsync("BTC", "USDT", GetJsonContent(_private_api.privateClient, "fetchBalance", _args)); - if (_balance.supported == true || TestConfig.SupportedCheck == true) + if (_balance.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _balance); @@ -168,7 +169,7 @@ public async void Poloniex() } var _balances = await _private_api.FetchBalancesAsync(GetJsonContent(_private_api.privateClient, "fetchBalances", _args)); - if (_balances.supported == true || TestConfig.SupportedCheck == true) + if (_balances.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _balances); @@ -184,7 +185,7 @@ public async void Poloniex() } var _wallet = await _private_api.FetchWalletAsync("XRP", "USD", GetJsonContent(_private_api.privateClient, "fetchWallet", _args)); - if (_wallet.supported == true || TestConfig.SupportedCheck == true) + if (_wallet.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _wallet); @@ -197,7 +198,7 @@ public async void Poloniex() } var _wallets = await _private_api.FetchWalletsAsync(_api_key.user_id, GetJsonContent(_private_api.privateClient, "fetchWallets", _args)); - if (_wallets.supported == true || TestConfig.SupportedCheck == true) + if (_wallets.supported || TestConfig.SupportedCheck) { this.WriteJson(_private_api.privateClient, _wallets); diff --git a/tests/ccxt.test/public/bithumb.cs b/tests/ccxt.test/public/bithumb.cs index 04adc95..214a4bd 100644 --- a/tests/ccxt.test/public/bithumb.cs +++ b/tests/ccxt.test/public/bithumb.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Threading.Tasks; using Xunit; namespace XUnit @@ -8,17 +9,17 @@ namespace XUnit public partial class PublicApi { [Fact] - public async void Bithumb() + public async Task Bithumb() { var _public_api = new CCXT.NET.Bithumb.Public.PublicApi(); var _args = new Dictionary(); var _timeframe = "1d"; - var _since = 0; //1514764800000; + var _since = 0; //1514764800000; var _limit = 100; var _markets = await _public_api.LoadMarketsAsync(false, GetJsonContent(_public_api.publicClient, "fetchMarkets", _args)); - if (_markets.supported == true || TestConfig.SupportedCheck == true) + if (_markets.supported || TestConfig.SupportedCheck) { this.WriteJson(_public_api.publicClient, _markets); @@ -38,7 +39,7 @@ public async void Bithumb() } var _ticker = await _public_api.FetchTickerAsync("XRP", "KRW", GetJsonContent(_public_api.publicClient, "fetchTicker", _args)); - if (_ticker.supported == true || TestConfig.SupportedCheck == true) + if (_ticker.supported || TestConfig.SupportedCheck) { this.WriteJson(_public_api.publicClient, _ticker); @@ -59,7 +60,7 @@ public async void Bithumb() } var _tickers = await _public_api.FetchTickersAsync(GetJsonContent(_public_api.publicClient, "fetchTickers", _args)); - if (_tickers.supported == true || TestConfig.SupportedCheck == true) + if (_tickers.supported || TestConfig.SupportedCheck) { this.WriteJson(_public_api.publicClient, _tickers); @@ -82,7 +83,7 @@ public async void Bithumb() } var _orderbook = await _public_api.FetchOrderBooksAsync("XRP", "KRW", _limit, GetJsonContent(_public_api.publicClient, "fetchOrderBooks", _args)); - if (_orderbook.supported == true || TestConfig.SupportedCheck == true) + if (_orderbook.supported || TestConfig.SupportedCheck) { this.WriteJson(_public_api.publicClient, _orderbook); @@ -122,7 +123,7 @@ public async void Bithumb() } var _ohlcvs = await _public_api.FetchOHLCVsAsync("XRP", "KRW", _timeframe, _since, _limit, GetJsonContent(_public_api.publicClient, "fetchOHLCVs", _args)); - if (_ohlcvs.supported == true || TestConfig.SupportedCheck == true) + if (_ohlcvs.supported || TestConfig.SupportedCheck) { this.WriteJson(_public_api.publicClient, _ohlcvs); @@ -142,7 +143,7 @@ public async void Bithumb() } var _trades = await _public_api.FetchCompleteOrdersAsync("XRP", "KRW", _timeframe, _since, _limit, GetJsonContent(_public_api.publicClient, "fetchCompleteOrders", _args)); - if (_trades.supported == true || TestConfig.SupportedCheck == true) + if (_trades.supported || TestConfig.SupportedCheck) { this.WriteJson(_public_api.publicClient, _trades); diff --git a/tests/ccxt.test/public/bitmex.cs b/tests/ccxt.test/public/bitmex.cs index b0187a7..8d4bc6a 100644 --- a/tests/ccxt.test/public/bitmex.cs +++ b/tests/ccxt.test/public/bitmex.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Threading.Tasks; using Xunit; namespace XUnit @@ -8,7 +9,7 @@ namespace XUnit public partial class PublicApi { [Fact] - public async void BitMEX() + public async Task BitMEX() { var _public_api = new CCXT.NET.BitMEX.Public.PublicApi(); @@ -18,7 +19,7 @@ public async void BitMEX() var _limit = 100; var _markets = await _public_api.LoadMarketsAsync(false, GetJsonContent(_public_api.publicClient, "fetchMarkets", _args)); - if (_markets.supported == true || TestConfig.SupportedCheck == true) + if (_markets.supported || TestConfig.SupportedCheck) { this.WriteJson(_public_api.publicClient, _markets); @@ -38,7 +39,7 @@ public async void BitMEX() } var _ticker = await _public_api.FetchTickerAsync("XRP", "U18", GetJsonContent(_public_api.publicClient, "fetchTicker", _args)); - if (_ticker.supported == true || TestConfig.SupportedCheck == true) + if (_ticker.supported || TestConfig.SupportedCheck) { this.WriteJson(_public_api.publicClient, _ticker); @@ -59,7 +60,7 @@ public async void BitMEX() } var _tickers = await _public_api.FetchTickersAsync(GetJsonContent(_public_api.publicClient, "fetchTickers", _args)); - if (_tickers.supported == true || TestConfig.SupportedCheck == true) + if (_tickers.supported || TestConfig.SupportedCheck) { this.WriteJson(_public_api.publicClient, _tickers); @@ -82,7 +83,7 @@ public async void BitMEX() } var _orderbook = await _public_api.FetchOrderBooksAsync("XRP", "U18", _limit, GetJsonContent(_public_api.publicClient, "fetchOrderBooks", _args)); - if (_orderbook.supported == true || TestConfig.SupportedCheck == true) + if (_orderbook.supported || TestConfig.SupportedCheck) { this.WriteJson(_public_api.publicClient, _orderbook); @@ -122,7 +123,7 @@ public async void BitMEX() } var _ohlcvs = await _public_api.FetchOHLCVsAsync("XRP", "U18", _timeframe, _since, _limit, GetJsonContent(_public_api.publicClient, "fetchOHLCVs", _args)); - if (_ohlcvs.supported == true || TestConfig.SupportedCheck == true) + if (_ohlcvs.supported || TestConfig.SupportedCheck) { this.WriteJson(_public_api.publicClient, _ohlcvs); @@ -142,7 +143,7 @@ public async void BitMEX() } var _trades = await _public_api.FetchCompleteOrdersAsync("XRP", "U18", _timeframe, _since, _limit, GetJsonContent(_public_api.publicClient, "fetchCompleteOrders", _args)); - if (_trades.supported == true || TestConfig.SupportedCheck == true) + if (_trades.supported || TestConfig.SupportedCheck) { this.WriteJson(_public_api.publicClient, _trades); diff --git a/tests/ccxt.test/public/coinone.cs b/tests/ccxt.test/public/coinone.cs index 0273110..2798a98 100644 --- a/tests/ccxt.test/public/coinone.cs +++ b/tests/ccxt.test/public/coinone.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Threading.Tasks; using Xunit; namespace XUnit @@ -8,7 +9,7 @@ namespace XUnit public partial class PublicApi { [Fact] - public async void Coinone() + public async Task Coinone() { var _public_api = new CCXT.NET.Coinone.Public.PublicApi(); @@ -18,7 +19,7 @@ public async void Coinone() var _limit = 100; var _markets = await _public_api.LoadMarketsAsync(false, GetJsonContent(_public_api.publicClient, "fetchMarkets", _args)); - if (_markets.supported == true || TestConfig.SupportedCheck == true) + if (_markets.supported || TestConfig.SupportedCheck) { this.WriteJson(_public_api.publicClient, _markets); @@ -38,7 +39,7 @@ public async void Coinone() } var _ticker = await _public_api.FetchTickerAsync("XRP", "KRW", GetJsonContent(_public_api.publicClient, "fetchTicker", _args)); - if (_ticker.supported == true || TestConfig.SupportedCheck == true) + if (_ticker.supported || TestConfig.SupportedCheck) { this.WriteJson(_public_api.publicClient, _ticker); @@ -59,7 +60,7 @@ public async void Coinone() } var _tickers = await _public_api.FetchTickersAsync(GetJsonContent(_public_api.publicClient, "fetchTickers", _args)); - if (_tickers.supported == true || TestConfig.SupportedCheck == true) + if (_tickers.supported || TestConfig.SupportedCheck) { this.WriteJson(_public_api.publicClient, _tickers); @@ -82,7 +83,7 @@ public async void Coinone() } var _orderbook = await _public_api.FetchOrderBooksAsync("XRP", "KRW", _limit, GetJsonContent(_public_api.publicClient, "fetchOrderBooks", _args)); - if (_orderbook.supported == true || TestConfig.SupportedCheck == true) + if (_orderbook.supported || TestConfig.SupportedCheck) { this.WriteJson(_public_api.publicClient, _orderbook); @@ -122,7 +123,7 @@ public async void Coinone() } var _ohlcvs = await _public_api.FetchOHLCVsAsync("XRP", "KRW", _timeframe, _since, _limit, GetJsonContent(_public_api.publicClient, "fetchOHLCVs", _args)); - if (_ohlcvs.supported == true || TestConfig.SupportedCheck == true) + if (_ohlcvs.supported || TestConfig.SupportedCheck) { this.WriteJson(_public_api.publicClient, _ohlcvs); @@ -142,7 +143,7 @@ public async void Coinone() } var _trades = await _public_api.FetchCompleteOrdersAsync("XRP", "KRW", _timeframe, _since, _limit, GetJsonContent(_public_api.publicClient, "fetchCompleteOrders", _args)); - if (_trades.supported == true || TestConfig.SupportedCheck == true) + if (_trades.supported || TestConfig.SupportedCheck) { this.WriteJson(_public_api.publicClient, _trades); diff --git a/tests/ccxt.test/public/korbit.cs b/tests/ccxt.test/public/korbit.cs index 7ae4be4..b83aef6 100644 --- a/tests/ccxt.test/public/korbit.cs +++ b/tests/ccxt.test/public/korbit.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Threading.Tasks; using Xunit; namespace XUnit @@ -8,7 +9,7 @@ namespace XUnit public partial class PublicApi { [Fact] - public async void Korbit() + public async Task Korbit() { var _public_api = new CCXT.NET.Korbit.Public.PublicApi(); @@ -18,7 +19,7 @@ public async void Korbit() var _limit = 100; var _markets = await _public_api.LoadMarketsAsync(false, GetJsonContent(_public_api.publicClient, "fetchMarkets", _args)); - if (_markets.supported == true || TestConfig.SupportedCheck == true) + if (_markets.supported || TestConfig.SupportedCheck) { this.WriteJson(_public_api.publicClient, _markets); @@ -38,7 +39,7 @@ public async void Korbit() } var _ticker = await _public_api.FetchTickerAsync("XRP", "KRW", GetJsonContent(_public_api.publicClient, "fetchTicker", _args)); - if (_ticker.supported == true || TestConfig.SupportedCheck == true) + if (_ticker.supported || TestConfig.SupportedCheck) { this.WriteJson(_public_api.publicClient, _ticker); @@ -59,7 +60,7 @@ public async void Korbit() } var _tickers = await _public_api.FetchTickersAsync(GetJsonContent(_public_api.publicClient, "fetchTickers", _args)); - if (_tickers.supported == true || TestConfig.SupportedCheck == true) + if (_tickers.supported || TestConfig.SupportedCheck) { this.WriteJson(_public_api.publicClient, _tickers); @@ -82,7 +83,7 @@ public async void Korbit() } var _orderbook = await _public_api.FetchOrderBooksAsync("XRP", "KRW", _limit, GetJsonContent(_public_api.publicClient, "fetchOrderBooks", _args)); - if (_orderbook.supported == true || TestConfig.SupportedCheck == true) + if (_orderbook.supported || TestConfig.SupportedCheck) { this.WriteJson(_public_api.publicClient, _orderbook); @@ -122,7 +123,7 @@ public async void Korbit() } var _ohlcvs = await _public_api.FetchOHLCVsAsync("XRP", "KRW", _timeframe, _since, _limit, GetJsonContent(_public_api.publicClient, "fetchOHLCVs", _args)); - if (_ohlcvs.supported == true || TestConfig.SupportedCheck == true) + if (_ohlcvs.supported || TestConfig.SupportedCheck) { this.WriteJson(_public_api.publicClient, _ohlcvs); @@ -142,7 +143,7 @@ public async void Korbit() } var _trades = await _public_api.FetchCompleteOrdersAsync("XRP", "KRW", _timeframe, _since, _limit, GetJsonContent(_public_api.publicClient, "fetchCompleteOrders", _args)); - if (_trades.supported == true || TestConfig.SupportedCheck == true) + if (_trades.supported || TestConfig.SupportedCheck) { this.WriteJson(_public_api.publicClient, _trades); diff --git a/tests/ccxt.test/public/poloniex.cs b/tests/ccxt.test/public/poloniex.cs index f01538e..beb28ba 100644 --- a/tests/ccxt.test/public/poloniex.cs +++ b/tests/ccxt.test/public/poloniex.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Threading.Tasks; using Xunit; namespace XUnit @@ -8,7 +9,7 @@ namespace XUnit public partial class PublicApi { [Fact] - public async void Poloniex() + public async Task Poloniex() { var _public_api = new CCXT.NET.Poloniex.Public.PublicApi(); @@ -18,7 +19,7 @@ public async void Poloniex() var _limit = 100; var _markets = await _public_api.LoadMarketsAsync(false, GetJsonContent(_public_api.publicClient, "fetchMarkets", _args)); - if (_markets.supported == true || TestConfig.SupportedCheck == true) + if (_markets.supported || TestConfig.SupportedCheck) { this.WriteJson(_public_api.publicClient, _markets); @@ -38,7 +39,7 @@ public async void Poloniex() } var _ticker = await _public_api.FetchTickerAsync("BTC", "USDT", GetJsonContent(_public_api.publicClient, "fetchTicker", _args)); - if (_ticker.supported == true || TestConfig.SupportedCheck == true) + if (_ticker.supported || TestConfig.SupportedCheck) { this.WriteJson(_public_api.publicClient, _ticker); @@ -59,7 +60,7 @@ public async void Poloniex() } var _tickers = await _public_api.FetchTickersAsync(GetJsonContent(_public_api.publicClient, "fetchTickers", _args)); - if (_tickers.supported == true || TestConfig.SupportedCheck == true) + if (_tickers.supported || TestConfig.SupportedCheck) { this.WriteJson(_public_api.publicClient, _tickers); @@ -82,7 +83,7 @@ public async void Poloniex() } var _orderbook = await _public_api.FetchOrderBooksAsync("BTC", "USDT", _limit, GetJsonContent(_public_api.publicClient, "fetchOrderBooks", _args)); - if (_orderbook.supported == true || TestConfig.SupportedCheck == true) + if (_orderbook.supported || TestConfig.SupportedCheck) { this.WriteJson(_public_api.publicClient, _orderbook); @@ -122,7 +123,7 @@ public async void Poloniex() } var _ohlcvs = await _public_api.FetchOHLCVsAsync("BTC", "USDT", _timeframe, _since, _limit, GetJsonContent(_public_api.publicClient, "fetchOHLCVs", _args)); - if (_ohlcvs.supported == true || TestConfig.SupportedCheck == true) + if (_ohlcvs.supported || TestConfig.SupportedCheck) { this.WriteJson(_public_api.publicClient, _ohlcvs); @@ -142,7 +143,7 @@ public async void Poloniex() } var _trades = await _public_api.FetchCompleteOrdersAsync("BTC", "USDT", _timeframe, _since, _limit, GetJsonContent(_public_api.publicClient, "fetchCompleteOrders", _args)); - if (_trades.supported == true || TestConfig.SupportedCheck == true) + if (_trades.supported || TestConfig.SupportedCheck) { this.WriteJson(_public_api.publicClient, _trades); diff --git a/tests/ccxt.test/rootApi.cs b/tests/ccxt.test/rootApi.cs index eebe3d8..b2a7ad6 100644 --- a/tests/ccxt.test/rootApi.cs +++ b/tests/ccxt.test/rootApi.cs @@ -84,14 +84,14 @@ public Dictionary GetJsonContent(XApiClient api_client, string r if (XApiClient.TestXUnitMode != XUnitMode.UseExchangeServer) { var _file_name = Path.Combine(root_folder, api_client.DealerName, $"{caller_name}.json"); - if (File.Exists(_file_name) == true) + if (File.Exists(_file_name)) { var _json_string = File.ReadAllText(_file_name); this.WriteLine(_file_name); this.WriteLine(_json_string); - if (args.ContainsKey("jsonContent") == true) + if (args.ContainsKey("jsonContent")) args.Remove("jsonContent"); args.Add("jsonContent", _json_string); } diff --git a/tests/ccxt.test/trade/bithumb.cs b/tests/ccxt.test/trade/bithumb.cs index 386f181..982f4bc 100644 --- a/tests/ccxt.test/trade/bithumb.cs +++ b/tests/ccxt.test/trade/bithumb.cs @@ -3,6 +3,7 @@ using CCXT.NET.Shared.Converter; using System; using System.Collections.Generic; +using System.Threading.Tasks; using Xunit; namespace XUnit @@ -10,7 +11,7 @@ namespace XUnit public partial class TradeApi { [Fact] - public async void Bithumb() + public async Task Bithumb() { var _api_key = TestConfig.GetConnectionKey("Bithumb"); var _args = new Dictionary(); @@ -33,7 +34,7 @@ public async void Bithumb() } var _fetch_my_orders = await _trade_api.FetchMyOrdersAsync("BTC", "KRW", _timeframe, _since, _limit, GetJsonContent(_trade_api.tradeClient, "fetchMyOrders", _args)); - if ((_fetch_my_orders.supported == true || TestConfig.SupportedCheck == true) && _fetch_my_orders.statusCode != 5600) + if ((_fetch_my_orders.supported || TestConfig.SupportedCheck) && _fetch_my_orders.statusCode != 5600) { this.WriteJson(_trade_api.tradeClient, _fetch_my_orders); @@ -65,7 +66,7 @@ public async void Bithumb() } var _fetch_my_order = await _trade_api.FetchMyOrderAsync("BTC", "KRW", _my_order_id, GetJsonContent(_trade_api.tradeClient, "fetchMyOrder", _args)); - if ((_fetch_my_order.supported == true || TestConfig.SupportedCheck == true) && _fetch_my_order.statusCode != 5600) + if ((_fetch_my_order.supported || TestConfig.SupportedCheck) && _fetch_my_order.statusCode != 5600) { this.WriteJson(_trade_api.tradeClient, _fetch_my_order); @@ -87,7 +88,7 @@ public async void Bithumb() }; var _fetch_open_orders = await _trade_api.FetchOpenOrdersAsync("BTC", "KRW", GetJsonContent(_trade_api.tradeClient, "fetchOpenOrders", _args)); - if ((_fetch_open_orders.supported == true || TestConfig.SupportedCheck == true) && _fetch_open_orders.statusCode != 5600) + if ((_fetch_open_orders.supported || TestConfig.SupportedCheck) && _fetch_open_orders.statusCode != 5600) { this.WriteJson(_trade_api.tradeClient, _fetch_open_orders); @@ -107,7 +108,7 @@ public async void Bithumb() } var _all_open_orders = await _trade_api.FetchAllOpenOrdersAsync(GetJsonContent(_trade_api.tradeClient, "fetchAllOpenOrders", _args)); - if (_all_open_orders.supported == true || TestConfig.SupportedCheck == true) + if (_all_open_orders.supported || TestConfig.SupportedCheck) { this.WriteJson(_trade_api.tradeClient, _all_open_orders); @@ -126,7 +127,7 @@ public async void Bithumb() } var _open_positions = await _trade_api.FetchAllOpenPositionsAsync(GetJsonContent(_trade_api.tradeClient, "fetchAllOpenPositions", _args)); - if (_open_positions.supported == true || TestConfig.SupportedCheck == true) + if (_open_positions.supported || TestConfig.SupportedCheck) { this.WriteJson(_trade_api.tradeClient, _open_positions); @@ -147,7 +148,7 @@ public async void Bithumb() } var _fetch_my_trades = await _trade_api.FetchMyTradesAsync("BTC", "KRW", _timeframe, _since, _limit, GetJsonContent(_trade_api.tradeClient, "fetchMyTrades", _args)); - if (_fetch_my_trades.supported == true || TestConfig.SupportedCheck == true) + if (_fetch_my_trades.supported || TestConfig.SupportedCheck) { this.WriteJson(_trade_api.tradeClient, _fetch_my_trades); @@ -171,7 +172,7 @@ public async void Bithumb() if (XApiClient.TestXUnitMode != XUnitMode.UseExchangeServer) { var _limit_order = await _trade_api.CreateLimitOrderAsync("BTC", "KRW", 1.0m, 2000m, SideType.Ask, GetJsonContent(_trade_api.tradeClient, "createLimitOrder", _args)); - if ((_limit_order.supported == true || TestConfig.SupportedCheck == true) && _limit_order.statusCode != 5600) + if ((_limit_order.supported || TestConfig.SupportedCheck) && _limit_order.statusCode != 5600) { this.WriteJson(_trade_api.tradeClient, _limit_order); @@ -185,7 +186,7 @@ public async void Bithumb() } var _market_order = await _trade_api.CreateMarketOrderAsync("BTC", "KRW", 1.0m, 2000m, SideType.Ask, GetJsonContent(_trade_api.tradeClient, "createMarketOrder", _args)); - if ((_market_order.supported == true || TestConfig.SupportedCheck == true) && _market_order.statusCode != 5600) + if ((_market_order.supported || TestConfig.SupportedCheck) && _market_order.statusCode != 5600) { this.WriteJson(_trade_api.tradeClient, _market_order); @@ -211,7 +212,7 @@ public async void Bithumb() } var _cancel_order = await _trade_api.CancelOrderAsync("BTC", "KRW", _open_order_id, 0.1m, 20000000m, SideType.Ask, GetJsonContent(_trade_api.tradeClient, "cancelOrder", _args)); - if ((_cancel_order.supported == true || TestConfig.SupportedCheck == true) && _cancel_order.statusCode != 5600) + if ((_cancel_order.supported || TestConfig.SupportedCheck) && _cancel_order.statusCode != 5600) { this.WriteJson(_trade_api.tradeClient, _cancel_order); @@ -226,7 +227,7 @@ public async void Bithumb() var _oder_ids = new string[] { _open_order_id }; var _cancel_orders = await _trade_api.CancelOrdersAsync("BTC", "KRW", _oder_ids, GetJsonContent(_trade_api.tradeClient, "cancelOrders", _args)); - if ((_cancel_orders.supported == true || TestConfig.SupportedCheck == true) && _cancel_orders.errorCode != ErrorCode.AuthenticationError) + if ((_cancel_orders.supported || TestConfig.SupportedCheck) && _cancel_orders.errorCode != ErrorCode.AuthenticationError) { this.WriteJson(_trade_api.tradeClient, _cancel_orders); @@ -236,7 +237,7 @@ public async void Bithumb() } var _cancel_all_orders = await _trade_api.CancelAllOrdersAsync(GetJsonContent(_trade_api.tradeClient, "cancelAllOrders", _args)); - if ((_cancel_all_orders.supported == true || TestConfig.SupportedCheck == true) && _cancel_all_orders.errorCode != ErrorCode.AuthenticationError) + if ((_cancel_all_orders.supported || TestConfig.SupportedCheck) && _cancel_all_orders.errorCode != ErrorCode.AuthenticationError) { this.WriteJson(_trade_api.tradeClient, _cancel_all_orders); diff --git a/tests/ccxt.test/trade/bitmex.cs b/tests/ccxt.test/trade/bitmex.cs index fa3b0da..d499460 100644 --- a/tests/ccxt.test/trade/bitmex.cs +++ b/tests/ccxt.test/trade/bitmex.cs @@ -3,6 +3,7 @@ using CCXT.NET.Shared.Converter; using System; using System.Collections.Generic; +using System.Threading.Tasks; using Xunit; namespace XUnit @@ -10,7 +11,7 @@ namespace XUnit public partial class TradeApi { [Fact] - public async void BitMEX() + public async Task BitMEX() { var _api_key = TestConfig.GetConnectionKey("BitMEX"); var _args = new Dictionary(); @@ -28,7 +29,7 @@ public async void BitMEX() #endif var _fetch_my_orders = await _trade_api.FetchMyOrdersAsync("BTC", "USD", _timeframe, _since, _limit, GetJsonContent(_trade_api.tradeClient, "fetchMyOrders", _args)); - if (_fetch_my_orders.supported == true || TestConfig.SupportedCheck == true) + if (_fetch_my_orders.supported || TestConfig.SupportedCheck) { this.WriteJson(_trade_api.tradeClient, _fetch_my_orders); @@ -54,7 +55,7 @@ public async void BitMEX() _my_order_id = _fetch_my_orders.result[0].orderId; var _fetch_my_order = await _trade_api.FetchMyOrderAsync("BTC", "USD", _my_order_id, GetJsonContent(_trade_api.tradeClient, "fetchMyOrder", _args)); - if (_fetch_my_order.supported == true || TestConfig.SupportedCheck == true) + if (_fetch_my_order.supported || TestConfig.SupportedCheck) { this.WriteJson(_trade_api.tradeClient, _fetch_my_order); @@ -70,7 +71,7 @@ public async void BitMEX() } var _fetch_open_orders = await _trade_api.FetchOpenOrdersAsync("BTC", "USD", GetJsonContent(_trade_api.tradeClient, "fetchOpenOrders", _args)); - if (_fetch_open_orders.supported == true || TestConfig.SupportedCheck == true) + if (_fetch_open_orders.supported || TestConfig.SupportedCheck) { this.WriteJson(_trade_api.tradeClient, _fetch_open_orders); @@ -90,7 +91,7 @@ public async void BitMEX() } var _all_open_orders = await _trade_api.FetchAllOpenOrdersAsync(GetJsonContent(_trade_api.tradeClient, "fetchAllOpenOrders", _args)); - if (_all_open_orders.supported == true || TestConfig.SupportedCheck == true) + if (_all_open_orders.supported || TestConfig.SupportedCheck) { this.WriteJson(_trade_api.tradeClient, _all_open_orders); @@ -109,7 +110,7 @@ public async void BitMEX() } var _open_positions = await _trade_api.FetchAllOpenPositionsAsync(GetJsonContent(_trade_api.tradeClient, "fetchAllOpenPositions", _args)); - if (_open_positions.supported == true || TestConfig.SupportedCheck == true) + if (_open_positions.supported || TestConfig.SupportedCheck) { this.WriteJson(_trade_api.tradeClient, _open_positions); @@ -130,7 +131,7 @@ public async void BitMEX() } var _fetch_my_trades = await _trade_api.FetchMyTradesAsync("BTC", "USD", _timeframe, _since, _limit, GetJsonContent(_trade_api.tradeClient, "fetchMyTrades", _args)); - if (_fetch_my_trades.supported == true || TestConfig.SupportedCheck == true) + if (_fetch_my_trades.supported || TestConfig.SupportedCheck) { this.WriteJson(_trade_api.tradeClient, _fetch_my_trades); @@ -154,7 +155,7 @@ public async void BitMEX() if (XApiClient.TestXUnitMode != XUnitMode.UseExchangeServer) { var _limit_order = await _trade_api.CreateLimitOrderAsync("BTC", "USD", 0.1m, 20000m, SideType.Ask, GetJsonContent(_trade_api.tradeClient, "createLimitOrder", _args)); - if ((_limit_order.supported == true || TestConfig.SupportedCheck == true) && _limit_order.message.IndexOf("lack of balance") < 0) + if ((_limit_order.supported || TestConfig.SupportedCheck) && _limit_order.message.IndexOf("lack of balance") < 0) { this.WriteJson(_trade_api.tradeClient, _limit_order); @@ -168,7 +169,7 @@ public async void BitMEX() } var _market_order = await _trade_api.CreateMarketOrderAsync("BTC", "USD", 0.1m, 20000m, SideType.Ask, GetJsonContent(_trade_api.tradeClient, "createMarketOrder", _args)); - if ((_market_order.supported == true || TestConfig.SupportedCheck == true) && _market_order.message.IndexOf("lack of balance") < 0) + if ((_market_order.supported || TestConfig.SupportedCheck) && _market_order.message.IndexOf("lack of balance") < 0) { this.WriteJson(_trade_api.tradeClient, _market_order); @@ -185,7 +186,7 @@ public async void BitMEX() var _order_id = Guid.NewGuid().ToString(); var _cancel_order = await _trade_api.CancelOrderAsync("BTC", "USD", _order_id, 0.1m, 20000m, SideType.Ask, GetJsonContent(_trade_api.tradeClient, "cancelOrder", _args)); - if ((_cancel_order.supported == true || TestConfig.SupportedCheck == true) && _cancel_order.errorCode != ErrorCode.OrderNotFound) + if ((_cancel_order.supported || TestConfig.SupportedCheck) && _cancel_order.errorCode != ErrorCode.OrderNotFound) { this.WriteJson(_trade_api.tradeClient, _cancel_order); @@ -200,7 +201,7 @@ public async void BitMEX() var _oder_ids = new string[] { _order_id }; var _cancel_orders = await _trade_api.CancelOrdersAsync("BTC", "USD", _oder_ids, GetJsonContent(_trade_api.tradeClient, "cancelOrders", _args)); - if ((_cancel_orders.supported == true || TestConfig.SupportedCheck == true) && _cancel_orders.errorCode != ErrorCode.OrderNotFound) + if ((_cancel_orders.supported || TestConfig.SupportedCheck) && _cancel_orders.errorCode != ErrorCode.OrderNotFound) { this.WriteJson(_trade_api.tradeClient, _cancel_orders); @@ -210,7 +211,7 @@ public async void BitMEX() } var _cancel_all_orders = await _trade_api.CancelAllOrdersAsync(GetJsonContent(_trade_api.tradeClient, "cancelAllOrders", _args)); - if ((_cancel_all_orders.supported == true || TestConfig.SupportedCheck == true) && _cancel_all_orders.errorCode != ErrorCode.OrderNotFound) + if ((_cancel_all_orders.supported || TestConfig.SupportedCheck) && _cancel_all_orders.errorCode != ErrorCode.OrderNotFound) { this.WriteJson(_trade_api.tradeClient, _cancel_all_orders); diff --git a/tests/ccxt.test/trade/coinone.cs b/tests/ccxt.test/trade/coinone.cs index 7a56e37..6ac29f1 100644 --- a/tests/ccxt.test/trade/coinone.cs +++ b/tests/ccxt.test/trade/coinone.cs @@ -3,6 +3,7 @@ using CCXT.NET.Shared.Converter; using System; using System.Collections.Generic; +using System.Threading.Tasks; using Xunit; namespace XUnit @@ -10,7 +11,7 @@ namespace XUnit public partial class TradeApi { [Fact] - public async void Coinone() + public async Task Coinone() { var _api_key = TestConfig.GetConnectionKey("Coinone"); var _args = new Dictionary(); @@ -28,7 +29,7 @@ public async void Coinone() #endif var _fetch_my_orders = await _trade_api.FetchMyOrdersAsync("XRP", "KRW", _timeframe, _since, _limit, GetJsonContent(_trade_api.tradeClient, "fetchMyOrders", _args)); - if (_fetch_my_orders.supported == true || TestConfig.SupportedCheck == true) + if (_fetch_my_orders.supported || TestConfig.SupportedCheck) { this.WriteJson(_trade_api.tradeClient, _fetch_my_orders); @@ -54,7 +55,7 @@ public async void Coinone() _my_order_id = _fetch_my_orders.result[0].orderId; var _fetch_my_order = await _trade_api.FetchMyOrderAsync("XRP", "KRW", _my_order_id, GetJsonContent(_trade_api.tradeClient, "fetchMyOrder", _args)); - if ((_fetch_my_order.supported == true || TestConfig.SupportedCheck == true) && _fetch_my_order.statusCode != 104) + if ((_fetch_my_order.supported || TestConfig.SupportedCheck) && _fetch_my_order.statusCode != 104) { this.WriteJson(_trade_api.tradeClient, _fetch_my_order); @@ -70,7 +71,7 @@ public async void Coinone() } var _fetch_open_orders = await _trade_api.FetchOpenOrdersAsync("XRP", "KRW", GetJsonContent(_trade_api.tradeClient, "fetchOpenOrders", _args)); - if (_fetch_open_orders.supported == true || TestConfig.SupportedCheck == true) + if (_fetch_open_orders.supported || TestConfig.SupportedCheck) { this.WriteJson(_trade_api.tradeClient, _fetch_open_orders); @@ -90,7 +91,7 @@ public async void Coinone() } var _all_open_orders = await _trade_api.FetchAllOpenOrdersAsync(GetJsonContent(_trade_api.tradeClient, "fetchAllOpenOrders", _args)); - if (_all_open_orders.supported == true || TestConfig.SupportedCheck == true) + if (_all_open_orders.supported || TestConfig.SupportedCheck) { this.WriteJson(_trade_api.tradeClient, _all_open_orders); @@ -109,7 +110,7 @@ public async void Coinone() } var _open_positions = await _trade_api.FetchAllOpenPositionsAsync(GetJsonContent(_trade_api.tradeClient, "fetchAllOpenPositions", _args)); - if (_open_positions.supported == true || TestConfig.SupportedCheck == true) + if (_open_positions.supported || TestConfig.SupportedCheck) { this.WriteJson(_trade_api.tradeClient, _open_positions); @@ -130,7 +131,7 @@ public async void Coinone() } var _fetch_my_trades = await _trade_api.FetchMyTradesAsync("XRP", "KRW", _timeframe, _since, _limit, GetJsonContent(_trade_api.tradeClient, "fetchMyTrades", _args)); - if (_fetch_my_trades.supported == true || TestConfig.SupportedCheck == true) + if (_fetch_my_trades.supported || TestConfig.SupportedCheck) { this.WriteJson(_trade_api.tradeClient, _fetch_my_trades); @@ -154,7 +155,7 @@ public async void Coinone() if (XApiClient.TestXUnitMode != XUnitMode.UseExchangeServer) { var _limit_order = await _trade_api.CreateLimitOrderAsync("XRP", "KRW", 1.0m, 2000m, SideType.Ask, GetJsonContent(_trade_api.tradeClient, "createLimitOrder", _args)); - if ((_limit_order.supported == true || TestConfig.SupportedCheck == true) && _limit_order.statusCode != 103) + if ((_limit_order.supported || TestConfig.SupportedCheck) && _limit_order.statusCode != 103) { this.WriteJson(_trade_api.tradeClient, _limit_order); @@ -168,7 +169,7 @@ public async void Coinone() } var _market_order = await _trade_api.CreateMarketOrderAsync("XRP", "KRW", 1.0m, 2000m, SideType.Ask, GetJsonContent(_trade_api.tradeClient, "createMarketOrder", _args)); - if ((_market_order.supported == true || TestConfig.SupportedCheck == true) && _market_order.statusCode != 103) + if ((_market_order.supported || TestConfig.SupportedCheck) && _market_order.statusCode != 103) { this.WriteJson(_trade_api.tradeClient, _market_order); @@ -185,7 +186,7 @@ public async void Coinone() var _order_id = Guid.NewGuid().ToString(); var _cancel_order = await _trade_api.CancelOrderAsync("XRP", "KRW", _order_id, 0.1m, 20000000m, SideType.Ask, GetJsonContent(_trade_api.tradeClient, "cancelOrder", _args)); - if ((_cancel_order.supported == true || TestConfig.SupportedCheck == true) && _cancel_order.statusCode != 104) + if ((_cancel_order.supported || TestConfig.SupportedCheck) && _cancel_order.statusCode != 104) { this.WriteJson(_trade_api.tradeClient, _cancel_order); @@ -200,7 +201,7 @@ public async void Coinone() var _oder_ids = new string[] { _order_id }; var _cancel_orders = await _trade_api.CancelOrdersAsync("ETH", "XRP", _oder_ids, GetJsonContent(_trade_api.tradeClient, "cancelOrders", _args)); - if ((_cancel_orders.supported == true || TestConfig.SupportedCheck == true) && _cancel_orders.errorCode != ErrorCode.AuthenticationError) + if ((_cancel_orders.supported || TestConfig.SupportedCheck) && _cancel_orders.errorCode != ErrorCode.AuthenticationError) { this.WriteJson(_trade_api.tradeClient, _cancel_orders); @@ -210,7 +211,7 @@ public async void Coinone() } var _cancel_all_orders = await _trade_api.CancelAllOrdersAsync(GetJsonContent(_trade_api.tradeClient, "cancelAllOrders", _args)); - if ((_cancel_all_orders.supported == true || TestConfig.SupportedCheck == true) && _cancel_all_orders.errorCode != ErrorCode.AuthenticationError) + if ((_cancel_all_orders.supported || TestConfig.SupportedCheck) && _cancel_all_orders.errorCode != ErrorCode.AuthenticationError) { this.WriteJson(_trade_api.tradeClient, _cancel_all_orders); diff --git a/tests/ccxt.test/trade/korbit.cs b/tests/ccxt.test/trade/korbit.cs index 2ce7b94..d4056ad 100644 --- a/tests/ccxt.test/trade/korbit.cs +++ b/tests/ccxt.test/trade/korbit.cs @@ -3,6 +3,7 @@ using CCXT.NET.Shared.Converter; using System; using System.Collections.Generic; +using System.Threading.Tasks; using Xunit; namespace XUnit @@ -10,7 +11,7 @@ namespace XUnit public partial class TradeApi { [Fact] - public async void Korbit() + public async Task Korbit() { var _api_key = TestConfig.GetConnectionKey("Korbit"); var _args = new Dictionary(); @@ -28,7 +29,7 @@ public async void Korbit() #endif var _fetch_my_orders = await _trade_api.FetchMyOrdersAsync("XRP", "KRW", _timeframe, _since, _limit, GetJsonContent(_trade_api.tradeClient, "fetchMyOrders", _args)); - if ((_fetch_my_orders.supported == true || TestConfig.SupportedCheck == true) && _fetch_my_orders.errorCode != ErrorCode.NotFoundData) + if ((_fetch_my_orders.supported || TestConfig.SupportedCheck) && _fetch_my_orders.errorCode != ErrorCode.NotFoundData) { this.WriteJson(_trade_api.tradeClient, _fetch_my_orders); @@ -54,7 +55,7 @@ public async void Korbit() _my_order_id = _fetch_my_orders.result[0].orderId; var _fetch_my_order = await _trade_api.FetchMyOrderAsync("XRP", "KRW", _my_order_id, GetJsonContent(_trade_api.tradeClient, "fetchMyOrder", _args)); - if ((_fetch_my_order.supported == true || TestConfig.SupportedCheck == true) && _fetch_my_order.errorCode != ErrorCode.NotFoundData) + if ((_fetch_my_order.supported || TestConfig.SupportedCheck) && _fetch_my_order.errorCode != ErrorCode.NotFoundData) { this.WriteJson(_trade_api.tradeClient, _fetch_my_order); @@ -70,7 +71,7 @@ public async void Korbit() } var _fetch_open_orders = await _trade_api.FetchOpenOrdersAsync("XRP", "KRW", GetJsonContent(_trade_api.tradeClient, "fetchOpenOrders", _args)); - if ((_fetch_open_orders.supported == true || TestConfig.SupportedCheck == true) && _fetch_open_orders.errorCode != ErrorCode.NotFoundData) + if ((_fetch_open_orders.supported || TestConfig.SupportedCheck) && _fetch_open_orders.errorCode != ErrorCode.NotFoundData) { this.WriteJson(_trade_api.tradeClient, _fetch_open_orders); @@ -90,7 +91,7 @@ public async void Korbit() } var _all_open_orders = await _trade_api.FetchAllOpenOrdersAsync(GetJsonContent(_trade_api.tradeClient, "fetchAllOpenOrders", _args)); - if ((_all_open_orders.supported == true || TestConfig.SupportedCheck == true) && _all_open_orders.errorCode != ErrorCode.NotFoundData) + if ((_all_open_orders.supported || TestConfig.SupportedCheck) && _all_open_orders.errorCode != ErrorCode.NotFoundData) { this.WriteJson(_trade_api.tradeClient, _all_open_orders); @@ -109,7 +110,7 @@ public async void Korbit() } var _open_positions = await _trade_api.FetchAllOpenPositionsAsync(GetJsonContent(_trade_api.tradeClient, "fetchAllOpenPositions", _args)); - if (_open_positions.supported == true || TestConfig.SupportedCheck == true) + if (_open_positions.supported || TestConfig.SupportedCheck) { this.WriteJson(_trade_api.tradeClient, _open_positions); @@ -130,7 +131,7 @@ public async void Korbit() } var _fetch_my_trades = await _trade_api.FetchMyTradesAsync("XRP", "KRW", _timeframe, _since, _limit, GetJsonContent(_trade_api.tradeClient, "fetchMyTrades", _args)); - if ((_fetch_my_trades.supported == true || TestConfig.SupportedCheck == true) && _fetch_my_trades.errorCode != ErrorCode.NotFoundData) + if ((_fetch_my_trades.supported || TestConfig.SupportedCheck) && _fetch_my_trades.errorCode != ErrorCode.NotFoundData) { this.WriteJson(_trade_api.tradeClient, _fetch_my_trades); @@ -154,7 +155,7 @@ public async void Korbit() if (XApiClient.TestXUnitMode != XUnitMode.UseExchangeServer) { var _limit_order = await _trade_api.CreateLimitOrderAsync("XRP", "KRW", 1.0m, 2000m, SideType.Ask, GetJsonContent(_trade_api.tradeClient, "createLimitOrder", _args)); - if ((_limit_order.supported == true || TestConfig.SupportedCheck == true) && _limit_order.message.IndexOf("not_enough") < 0) + if ((_limit_order.supported || TestConfig.SupportedCheck) && _limit_order.message.IndexOf("not_enough") < 0) { this.WriteJson(_trade_api.tradeClient, _limit_order); @@ -168,7 +169,7 @@ public async void Korbit() } var _market_order = await _trade_api.CreateMarketOrderAsync("XRP", "KRW", 1.0m, 2000m, SideType.Ask, GetJsonContent(_trade_api.tradeClient, "createMarketOrder", _args)); - if ((_market_order.supported == true || TestConfig.SupportedCheck == true) && _market_order.message.IndexOf("not_enough") < 0) + if ((_market_order.supported || TestConfig.SupportedCheck) && _market_order.message.IndexOf("not_enough") < 0) { this.WriteJson(_trade_api.tradeClient, _market_order); @@ -185,7 +186,7 @@ public async void Korbit() var _order_id = _trade_api.tradeClient.GenerateNonceString(13, 6); var _cancel_order = await _trade_api.CancelOrderAsync("XRP", "KRW", _order_id, 1.0m, 20000m, SideType.Ask, GetJsonContent(_trade_api.tradeClient, "cancelOrder", _args)); - if ((_cancel_order.supported == true || TestConfig.SupportedCheck == true) && _cancel_order.message.IndexOf("not_authorized") < 0) + if ((_cancel_order.supported || TestConfig.SupportedCheck) && _cancel_order.message.IndexOf("not_authorized") < 0) { this.WriteJson(_trade_api.tradeClient, _cancel_order); @@ -200,7 +201,7 @@ public async void Korbit() var _oder_ids = new string[] { _order_id }; var _cancel_orders = await _trade_api.CancelOrdersAsync("XRP", "KRW", _oder_ids, GetJsonContent(_trade_api.tradeClient, "cancelOrders", _args)); - if ((_cancel_orders.supported == true || TestConfig.SupportedCheck == true) && _cancel_orders.errorCode != ErrorCode.AuthenticationError) + if ((_cancel_orders.supported || TestConfig.SupportedCheck) && _cancel_orders.errorCode != ErrorCode.AuthenticationError) { this.WriteJson(_trade_api.tradeClient, _cancel_orders); @@ -210,7 +211,7 @@ public async void Korbit() } var _cancel_all_orders = await _trade_api.CancelAllOrdersAsync(GetJsonContent(_trade_api.tradeClient, "cancelAllOrders", _args)); - if ((_cancel_all_orders.supported == true || TestConfig.SupportedCheck == true) && _cancel_all_orders.errorCode != ErrorCode.AuthenticationError) + if ((_cancel_all_orders.supported || TestConfig.SupportedCheck) && _cancel_all_orders.errorCode != ErrorCode.AuthenticationError) { this.WriteJson(_trade_api.tradeClient, _cancel_all_orders); diff --git a/tests/ccxt.test/trade/poloniex.cs b/tests/ccxt.test/trade/poloniex.cs index e65b666..62ce3c1 100644 --- a/tests/ccxt.test/trade/poloniex.cs +++ b/tests/ccxt.test/trade/poloniex.cs @@ -3,6 +3,7 @@ using CCXT.NET.Shared.Converter; using System; using System.Collections.Generic; +using System.Threading.Tasks; using Xunit; namespace XUnit @@ -10,7 +11,7 @@ namespace XUnit public partial class TradeApi { [Fact] - public async void Poloniex() + public async Task Poloniex() { var _api_key = TestConfig.GetConnectionKey("Poloniex"); var _args = new Dictionary(); @@ -28,7 +29,7 @@ public async void Poloniex() #endif var _fetch_my_orders = await _trade_api.FetchMyOrdersAsync("BTC", "USDT", _timeframe, _since, _limit, GetJsonContent(_trade_api.tradeClient, "fetchMyOrders", _args)); - if ((_fetch_my_orders.supported == true || TestConfig.SupportedCheck == true) && _fetch_my_orders.errorCode != ErrorCode.NotFoundData) + if ((_fetch_my_orders.supported || TestConfig.SupportedCheck) && _fetch_my_orders.errorCode != ErrorCode.NotFoundData) { this.WriteJson(_trade_api.tradeClient, _fetch_my_orders); @@ -54,7 +55,7 @@ public async void Poloniex() _my_order_id = _fetch_my_orders.result[0].orderId; var _fetch_my_order = await _trade_api.FetchMyOrderAsync("BTC", "USDT", _my_order_id, GetJsonContent(_trade_api.tradeClient, "fetchMyOrder", _args)); - if ((_fetch_my_order.supported == true || TestConfig.SupportedCheck == true) && _fetch_my_order.errorCode != ErrorCode.NotFoundData) + if ((_fetch_my_order.supported || TestConfig.SupportedCheck) && _fetch_my_order.errorCode != ErrorCode.NotFoundData) { this.WriteJson(_trade_api.tradeClient, _fetch_my_order); @@ -70,7 +71,7 @@ public async void Poloniex() } var _fetch_open_orders = await _trade_api.FetchOpenOrdersAsync("BTC", "USDT", GetJsonContent(_trade_api.tradeClient, "fetchOpenOrders", _args)); - if ((_fetch_open_orders.supported == true || TestConfig.SupportedCheck == true) && _fetch_open_orders.errorCode != ErrorCode.NotFoundData) + if ((_fetch_open_orders.supported || TestConfig.SupportedCheck) && _fetch_open_orders.errorCode != ErrorCode.NotFoundData) { this.WriteJson(_trade_api.tradeClient, _fetch_open_orders); @@ -90,7 +91,7 @@ public async void Poloniex() } var _all_open_orders = await _trade_api.FetchAllOpenOrdersAsync(GetJsonContent(_trade_api.tradeClient, "fetchAllOpenOrders", _args)); - if ((_all_open_orders.supported == true || TestConfig.SupportedCheck == true) && _all_open_orders.errorCode != ErrorCode.NotFoundData) + if ((_all_open_orders.supported || TestConfig.SupportedCheck) && _all_open_orders.errorCode != ErrorCode.NotFoundData) { this.WriteJson(_trade_api.tradeClient, _all_open_orders); @@ -109,7 +110,7 @@ public async void Poloniex() } var _open_positions = await _trade_api.FetchAllOpenPositionsAsync(GetJsonContent(_trade_api.tradeClient, "fetchAllOpenPositions", _args)); - if (_open_positions.supported == true || TestConfig.SupportedCheck == true) + if (_open_positions.supported || TestConfig.SupportedCheck) { this.WriteJson(_trade_api.tradeClient, _open_positions); @@ -130,7 +131,7 @@ public async void Poloniex() } var _fetch_my_trades = await _trade_api.FetchMyTradesAsync("BTC", "USDT", _timeframe, _since, _limit, GetJsonContent(_trade_api.tradeClient, "fetchMyTrades", _args)); - if ((_fetch_my_trades.supported == true || TestConfig.SupportedCheck == true) && _fetch_my_trades.errorCode != ErrorCode.NotFoundData) + if ((_fetch_my_trades.supported || TestConfig.SupportedCheck) && _fetch_my_trades.errorCode != ErrorCode.NotFoundData) { this.WriteJson(_trade_api.tradeClient, _fetch_my_trades); @@ -154,7 +155,7 @@ public async void Poloniex() if (XApiClient.TestXUnitMode != XUnitMode.UseExchangeServer) { var _limit_order = await _trade_api.CreateLimitOrderAsync("BTC", "USDT", 0.1m, 20000m, SideType.Ask, GetJsonContent(_trade_api.tradeClient, "createLimitOrder", _args)); - if ((_limit_order.supported == true || TestConfig.SupportedCheck == true) && _limit_order.message.IndexOf("Not enough") < 0) + if ((_limit_order.supported || TestConfig.SupportedCheck) && _limit_order.message.IndexOf("Not enough") < 0) { this.WriteJson(_trade_api.tradeClient, _limit_order); @@ -168,7 +169,7 @@ public async void Poloniex() } var _market_order = await _trade_api.CreateMarketOrderAsync("BTC", "USDT", 0.1m, 20000m, SideType.Ask, GetJsonContent(_trade_api.tradeClient, "createMarketOrder", _args)); - if ((_market_order.supported == true || TestConfig.SupportedCheck == true) && _market_order.message.IndexOf("Not enough") < 0) + if ((_market_order.supported || TestConfig.SupportedCheck) && _market_order.message.IndexOf("Not enough") < 0) { this.WriteJson(_trade_api.tradeClient, _market_order); @@ -185,7 +186,7 @@ public async void Poloniex() var _order_id = _trade_api.tradeClient.GenerateNonceString(16, 6); var _cancel_order = await _trade_api.CancelOrderAsync("BTC", "USDT", _order_id, 0.1m, 20000m, SideType.Ask, GetJsonContent(_trade_api.tradeClient, "cancelOrder", _args)); - if ((_cancel_order.supported == true || TestConfig.SupportedCheck == true) && _cancel_order.message.IndexOf("Invalid order number") < 0) + if ((_cancel_order.supported || TestConfig.SupportedCheck) && _cancel_order.message.IndexOf("Invalid order number") < 0) { this.WriteJson(_trade_api.tradeClient, _cancel_order); @@ -200,7 +201,7 @@ public async void Poloniex() var _oder_ids = new string[] { _order_id }; var _cancel_orders = await _trade_api.CancelOrdersAsync("BTC", "USDT", _oder_ids, GetJsonContent(_trade_api.tradeClient, "cancelOrders", _args)); - if ((_cancel_orders.supported == true || TestConfig.SupportedCheck == true) && _cancel_orders.errorCode != ErrorCode.AuthenticationError) + if ((_cancel_orders.supported || TestConfig.SupportedCheck) && _cancel_orders.errorCode != ErrorCode.AuthenticationError) { this.WriteJson(_trade_api.tradeClient, _cancel_orders); @@ -210,7 +211,7 @@ public async void Poloniex() } var _cancel_all_orders = await _trade_api.CancelAllOrdersAsync(GetJsonContent(_trade_api.tradeClient, "cancelAllOrders", _args)); - if ((_cancel_all_orders.supported == true || TestConfig.SupportedCheck == true) && _cancel_all_orders.errorCode != ErrorCode.AuthenticationError) + if ((_cancel_all_orders.supported || TestConfig.SupportedCheck) && _cancel_all_orders.errorCode != ErrorCode.AuthenticationError) { this.WriteJson(_trade_api.tradeClient, _cancel_all_orders);