diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore index 8a30d25..b141a25 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore # User-specific files *.rsuser @@ -13,9 +13,6 @@ # User-specific files (MonoDevelop/Xamarin Studio) *.userprefs -# Mono auto generated files -mono_crash.* - # Build results [Dd]ebug/ [Dd]ebugPublic/ @@ -23,14 +20,13 @@ mono_crash.* [Rr]eleases/ x64/ x86/ -[Ww][Ii][Nn]32/ [Aa][Rr][Mm]/ [Aa][Rr][Mm]64/ bld/ [Bb]in/ [Oo]bj/ [Ll]og/ -[Ll]ogs/ +Files/ # Visual Studio 2015/2017 cache/options directory .vs/ @@ -44,10 +40,9 @@ Generated\ Files/ [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* -# NUnit +# NUNIT *.VisualState.xml TestResult.xml -nunit-*.xml # Build Results of an ATL Project [Dd]ebugPS/ @@ -57,14 +52,12 @@ dlldata.c # Benchmark Results BenchmarkDotNet.Artifacts/ +fail-*.txt # .NET Core project.lock.json project.fragment.lock.json artifacts/ -# ASP.NET Scaffolding -ScaffoldingReadMe.txt - # StyleCop StyleCopReport.xml @@ -90,7 +83,6 @@ StyleCopReport.xml *.tmp_proj *_wpftmp.csproj *.log -*.tlog *.vspscc *.vssscc .builds @@ -132,6 +124,9 @@ _ReSharper*/ *.[Rr]e[Ss]harper *.DotSettings.user +# JustCode is a .NET coding add-in +.JustCode + # TeamCity is a build add-in _TeamCity* @@ -142,11 +137,6 @@ _TeamCity* .axoCover/* !.axoCover/settings.json -# Coverlet is a free, cross platform Code Coverage Tool -coverage*.json -coverage*.xml -coverage*.info - # Visual Studio code coverage results *.coverage *.coveragexml @@ -194,8 +184,6 @@ PublishScripts/ # NuGet Packages *.nupkg -# NuGet Symbol Packages -*.snupkg # The packages folder can be ignored because of Package Restore **/[Pp]ackages/* # except build/, which is used as an MSBuild target. @@ -220,8 +208,6 @@ BundleArtifacts/ Package.StoreAssociation.xml _pkginfo.txt *.appx -*.appxbundle -*.appxupload # Visual Studio cache files # files ending in .cache can be ignored @@ -271,9 +257,7 @@ ServiceFabricBackup/ *.bim.layout *.bim_*.settings *.rptproj.rsuser -*- [Bb]ackup.rdl -*- [Bb]ackup ([0-9]).rdl -*- [Bb]ackup ([0-9][0-9]).rdl +*- Backup*.rdl # Microsoft Fakes FakesAssemblies/ @@ -294,17 +278,6 @@ node_modules/ # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) *.vbw -# Visual Studio 6 auto-generated project file (contains which files were open etc.) -*.vbp - -# Visual Studio 6 workspace and project file (working project files containing files to include in project) -*.dsw -*.dsp - -# Visual Studio 6 technical files -*.ncb -*.aps - # Visual Studio LightSwitch build output **/*.HTMLClient/GeneratedArtifacts **/*.DesktopClient/GeneratedArtifacts @@ -320,6 +293,10 @@ paket-files/ # FAKE - F# Make .fake/ +# JetBrains Rider +.idea/ +*.sln.iml + # CodeRush personal settings .cr/personal @@ -361,38 +338,5 @@ ASALocalRun/ # Local History for Visual Studio .localhistory/ -# Visual Studio History (VSHistory) files -.vshistory/ - # BeatPulse healthcheck temp database -healthchecksdb - -# Backup folder for Package Reference Convert tool in Visual Studio 2017 -MigrationBackup/ - -# Ionide (cross platform F# VS Code tools) working folder -.ionide/ - -# Fody - auto-generated XML schema -FodyWeavers.xsd - -# VS Code files for those working on multiple tools -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json -*.code-workspace - -# Local History for Visual Studio Code -.history/ - -# Windows Installer files from build outputs -*.cab -*.msi -*.msix -*.msm -*.msp - -# JetBrains Rider -*.sln.iml +healthchecksdb \ No newline at end of file diff --git a/src/Clients/MexcRestClient.cs b/src/Clients/MexcRestClient.cs index 83d0cf4..28a82ac 100644 --- a/src/Clients/MexcRestClient.cs +++ b/src/Clients/MexcRestClient.cs @@ -1,9 +1,12 @@ -using Mexc.Net.Clients.SpotApi; +using System; +using System.Net.Http; +using CryptoExchange.Net; +using Mexc.Net.Clients.SpotApi; using Mexc.Net.Interfaces.Clients; using Mexc.Net.Interfaces.Clients.SpotApi; using Mexc.Net.Objects; using Mexc.Net.Objects.Options; -using Microsoft.Extensions.Options; +using Microsoft.Extensions.Logging; namespace Mexc.Net.Clients; diff --git a/src/Clients/MexcSocketClient.cs b/src/Clients/MexcSocketClient.cs index 61c8932..77ca1e7 100644 --- a/src/Clients/MexcSocketClient.cs +++ b/src/Clients/MexcSocketClient.cs @@ -1,8 +1,11 @@ -using Mexc.Net.Clients.SpotApi; +using System; +using CryptoExchange.Net; +using Mexc.Net.Clients.SpotApi; using Mexc.Net.Interfaces.Clients; using Mexc.Net.Interfaces.Clients.SpotApi; using Mexc.Net.Objects; using Mexc.Net.Objects.Options; +using Microsoft.Extensions.Logging; namespace Mexc.Net.Clients; diff --git a/src/Clients/SpotApi/MexcClientSpotApi.cs b/src/Clients/SpotApi/MexcClientSpotApi.cs index b894ad9..1cd7b2e 100644 --- a/src/Clients/SpotApi/MexcClientSpotApi.cs +++ b/src/Clients/SpotApi/MexcClientSpotApi.cs @@ -1,5 +1,15 @@ -using CryptoExchange.Net.CommonObjects; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; +using CryptoExchange.Net; +using CryptoExchange.Net.Authentication; +using CryptoExchange.Net.CommonObjects; using CryptoExchange.Net.Interfaces.CommonClients; +using CryptoExchange.Net.Objects; using Mexc.Net.Converters; using Mexc.Net.Enums; using Mexc.Net.Interfaces.Clients.SpotApi; @@ -7,6 +17,8 @@ using Mexc.Net.Objects.Internal; using Mexc.Net.Objects.Models; using Mexc.Net.Objects.Options; +using Microsoft.Extensions.Logging; +using Newtonsoft.Json; namespace Mexc.Net.Clients.SpotApi; diff --git a/src/Clients/SpotApi/MexcClientSpotApiAccount.cs b/src/Clients/SpotApi/MexcClientSpotApiAccount.cs index 7603f0b..2a3eaa1 100644 --- a/src/Clients/SpotApi/MexcClientSpotApiAccount.cs +++ b/src/Clients/SpotApi/MexcClientSpotApiAccount.cs @@ -1,4 +1,9 @@ -using Mexc.Net.Interfaces.Clients.SpotApi; +using System.Collections.Generic; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; +using CryptoExchange.Net.Objects; +using Mexc.Net.Interfaces.Clients.SpotApi; using Mexc.Net.Objects.Models; namespace Mexc.Net.Clients.SpotApi; diff --git a/src/Clients/SpotApi/MexcClientSpotApiExchangeData.cs b/src/Clients/SpotApi/MexcClientSpotApiExchangeData.cs index 79946ec..0d2cee2 100644 --- a/src/Clients/SpotApi/MexcClientSpotApiExchangeData.cs +++ b/src/Clients/SpotApi/MexcClientSpotApiExchangeData.cs @@ -1,8 +1,19 @@ -using Mexc.Net.Converters; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; +using CryptoExchange.Net; +using CryptoExchange.Net.Converters; +using CryptoExchange.Net.Objects; +using Mexc.Net.Converters; using Mexc.Net.Enums; using Mexc.Net.Interfaces.Clients; using Mexc.Net.Interfaces.Clients.SpotApi; using Mexc.Net.Objects.Models; +using Newtonsoft.Json; namespace Mexc.Net.Clients.SpotApi; diff --git a/src/Clients/SpotApi/MexcClientSpotApiTrading.cs b/src/Clients/SpotApi/MexcClientSpotApiTrading.cs index 5ace533..506af7e 100644 --- a/src/Clients/SpotApi/MexcClientSpotApiTrading.cs +++ b/src/Clients/SpotApi/MexcClientSpotApiTrading.cs @@ -1,7 +1,17 @@ -using CryptoExchange.Net.CommonObjects; -using Mexc.NET.Enums; -using Mexc.NET.Interfaces.Clients.SpotApi; -using Mexc.NET.Objects.Models; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; +using CryptoExchange.Net; +using CryptoExchange.Net.CommonObjects; +using CryptoExchange.Net.Objects; +using Mexc.Net; +using Mexc.Net.Clients.SpotApi; +using Mexc.Net.Enums; +using Mexc.Net.Interfaces.Clients.SpotApi; +using Mexc.Net.Objects.Models; namespace Mexc.NET.Clients.SpotApi; diff --git a/src/Clients/SpotApi/MexcSocketClientSpotStreams.cs b/src/Clients/SpotApi/MexcSocketClientSpotStreams.cs index cbb26fb..047a97b 100644 --- a/src/Clients/SpotApi/MexcSocketClientSpotStreams.cs +++ b/src/Clients/SpotApi/MexcSocketClientSpotStreams.cs @@ -1,4 +1,13 @@ -using CryptoExchange.Net.Sockets; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using CryptoExchange.Net; +using CryptoExchange.Net.Authentication; +using CryptoExchange.Net.Objects; +using CryptoExchange.Net.Sockets; using Mexc.Net.Converters; using Mexc.Net.Enums; using Mexc.Net.Interfaces.Clients.SpotApi; @@ -7,6 +16,9 @@ using Mexc.Net.Objects.Models; using Mexc.Net.Objects.Models.Spot.Socket; using Mexc.Net.Objects.Options; +using Microsoft.Extensions.Logging; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; namespace Mexc.Net.Clients.SpotApi; @@ -77,7 +89,7 @@ internal async Task> SubscribeAsync(string url { Method = "SUBSCRIPTION", Params = topics.ToArray(), - Id = CryptoExchange.Net.ExchangeHelpers.NextId() + Id = ExchangeHelpers.NextId() }; return await SubscribeAsync(url, request, null, false, onData, ct); diff --git a/src/Converters/InstrumentTypeConverter.cs b/src/Converters/InstrumentTypeConverter.cs index 5733443..8c5edd5 100644 --- a/src/Converters/InstrumentTypeConverter.cs +++ b/src/Converters/InstrumentTypeConverter.cs @@ -1,4 +1,6 @@ -using Mexc.Net.Enums; +using System.Collections.Generic; +using CryptoExchange.Net.Converters; +using Mexc.Net.Enums; namespace Mexc.Net.Converters; diff --git a/src/Converters/InterfaceConverter.cs b/src/Converters/InterfaceConverter.cs index 096531f..10699d9 100644 --- a/src/Converters/InterfaceConverter.cs +++ b/src/Converters/InterfaceConverter.cs @@ -1,4 +1,7 @@ -namespace Mexc.Net.Converters; +using System; +using Newtonsoft.Json; + +namespace Mexc.Net.Converters; internal class InterfaceConverter : JsonConverter { diff --git a/src/Converters/KlineIntervalConverter.cs b/src/Converters/KlineIntervalConverter.cs index 978cae8..1f64af5 100644 --- a/src/Converters/KlineIntervalConverter.cs +++ b/src/Converters/KlineIntervalConverter.cs @@ -1,4 +1,6 @@ -using Mexc.Net.Enums; +using System.Collections.Generic; +using CryptoExchange.Net.Converters; +using Mexc.Net.Enums; namespace Mexc.Net.Converters; diff --git a/src/Converters/OrderSideConverter.cs b/src/Converters/OrderSideConverter.cs index a5fd605..4f788be 100644 --- a/src/Converters/OrderSideConverter.cs +++ b/src/Converters/OrderSideConverter.cs @@ -1,4 +1,6 @@ -using Mexc.Net.Enums; +using System.Collections.Generic; +using CryptoExchange.Net.Converters; +using Mexc.Net.Enums; namespace Mexc.Net.Converters; diff --git a/src/Converters/OrderStatusConverter.cs b/src/Converters/OrderStatusConverter.cs index db7443e..12678a4 100644 --- a/src/Converters/OrderStatusConverter.cs +++ b/src/Converters/OrderStatusConverter.cs @@ -1,4 +1,6 @@ -using Mexc.Net.Enums; +using System.Collections.Generic; +using CryptoExchange.Net.Converters; +using Mexc.Net.Enums; namespace Mexc.Net.Converters; diff --git a/src/Converters/RateLimitConverter.cs b/src/Converters/RateLimitConverter.cs index 35c062c..6d45d0f 100644 --- a/src/Converters/RateLimitConverter.cs +++ b/src/Converters/RateLimitConverter.cs @@ -1,4 +1,6 @@ -using Mexc.Net.Enums; +using System.Collections.Generic; +using CryptoExchange.Net.Converters; +using Mexc.Net.Enums; namespace Mexc.Net.Converters; diff --git a/src/Converters/SpotOrderTypeConverter.cs b/src/Converters/SpotOrderTypeConverter.cs index a381789..fbc7f32 100644 --- a/src/Converters/SpotOrderTypeConverter.cs +++ b/src/Converters/SpotOrderTypeConverter.cs @@ -1,4 +1,8 @@ -using Mexc.Net.Enums; +using System; +using System.Collections.Generic; +using System.Linq; +using Mexc.Net.Enums; +using Newtonsoft.Json; namespace Mexc.Net.Converters; diff --git a/src/Converters/StreamKlineIntervalConverter.cs b/src/Converters/StreamKlineIntervalConverter.cs index a96efbd..1882bc4 100644 --- a/src/Converters/StreamKlineIntervalConverter.cs +++ b/src/Converters/StreamKlineIntervalConverter.cs @@ -1,4 +1,6 @@ -using Mexc.Net.Enums; +using System.Collections.Generic; +using CryptoExchange.Net.Converters; +using Mexc.Net.Enums; namespace Mexc.Net.Converters; diff --git a/src/Converters/SymbolFilterConverter.cs b/src/Converters/SymbolFilterConverter.cs index 51ca995..5b8b5c3 100644 --- a/src/Converters/SymbolFilterConverter.cs +++ b/src/Converters/SymbolFilterConverter.cs @@ -1,6 +1,9 @@ -using Mexc.Net.Enums; +using System; +using Mexc.Net.Enums; using Mexc.Net.Objects.Models; using System.Diagnostics; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; namespace Mexc.Net.Converters; diff --git a/src/Converters/SymbolFilterTypeConverter.cs b/src/Converters/SymbolFilterTypeConverter.cs index 055cb27..acde2fe 100644 --- a/src/Converters/SymbolFilterTypeConverter.cs +++ b/src/Converters/SymbolFilterTypeConverter.cs @@ -1,4 +1,6 @@ -using Mexc.Net.Enums; +using System.Collections.Generic; +using CryptoExchange.Net.Converters; +using Mexc.Net.Enums; namespace Mexc.Net.Converters; diff --git a/src/Converters/SymbolStatusConverter.cs b/src/Converters/SymbolStatusConverter.cs index f45a2ff..f5173b5 100644 --- a/src/Converters/SymbolStatusConverter.cs +++ b/src/Converters/SymbolStatusConverter.cs @@ -1,4 +1,6 @@ -using Mexc.Net.Enums; +using System.Collections.Generic; +using CryptoExchange.Net.Converters; +using Mexc.Net.Enums; namespace Mexc.Net.Converters; diff --git a/src/Converters/TimeInForceConverter.cs b/src/Converters/TimeInForceConverter.cs index b7bccfa..16f977d 100644 --- a/src/Converters/TimeInForceConverter.cs +++ b/src/Converters/TimeInForceConverter.cs @@ -1,4 +1,6 @@ -using Mexc.Net.Enums; +using System.Collections.Generic; +using CryptoExchange.Net.Converters; +using Mexc.Net.Enums; namespace Mexc.Net.Converters; diff --git a/src/Enums/StopCondition.cs b/src/Enums/StopCondition.cs index fb4abe8..4e54e61 100644 --- a/src/Enums/StopCondition.cs +++ b/src/Enums/StopCondition.cs @@ -1,4 +1,7 @@ using CryptoExchange.Net.Attributes; +using CryptoExchange.Net.Converters; +using Newtonsoft.Json; + namespace Mexc.Net.Enums; /// diff --git a/src/Enums/StopOrderEvent.cs b/src/Enums/StopOrderEvent.cs index d9603e8..9a7e35b 100644 --- a/src/Enums/StopOrderEvent.cs +++ b/src/Enums/StopOrderEvent.cs @@ -1,4 +1,7 @@ using CryptoExchange.Net.Attributes; +using CryptoExchange.Net.Converters; +using Newtonsoft.Json; + namespace Mexc.Net.Enums; /// diff --git a/src/Interfaces/Clients/IMexc24HPriceBase.cs b/src/Interfaces/Clients/IMexc24HPriceBase.cs index ff937de..5a82d84 100644 --- a/src/Interfaces/Clients/IMexc24HPriceBase.cs +++ b/src/Interfaces/Clients/IMexc24HPriceBase.cs @@ -1,4 +1,6 @@ -namespace Mexc.Net.Interfaces.Clients; +using System; + +namespace Mexc.Net.Interfaces.Clients; /// /// 24 hour price stats diff --git a/src/Interfaces/Clients/IMexcRestClient.cs b/src/Interfaces/Clients/IMexcRestClient.cs index e8c7a41..4dce67e 100644 --- a/src/Interfaces/Clients/IMexcRestClient.cs +++ b/src/Interfaces/Clients/IMexcRestClient.cs @@ -1,4 +1,5 @@ -using Mexc.Net.Interfaces.Clients.SpotApi; +using CryptoExchange.Net.Interfaces; +using Mexc.Net.Interfaces.Clients.SpotApi; using Mexc.Net.Objects; namespace Mexc.Net.Interfaces.Clients; diff --git a/src/Interfaces/Clients/IMexcSocketClient.cs b/src/Interfaces/Clients/IMexcSocketClient.cs index 9385d6e..6734040 100644 --- a/src/Interfaces/Clients/IMexcSocketClient.cs +++ b/src/Interfaces/Clients/IMexcSocketClient.cs @@ -1,4 +1,6 @@ -namespace Mexc.Net.Interfaces.Clients; +using CryptoExchange.Net.Interfaces; + +namespace Mexc.Net.Interfaces.Clients; public interface IMexcSocketClient : ISocketClient { diff --git a/src/Interfaces/Clients/SpotApi/IMexcClientSpotApi.cs b/src/Interfaces/Clients/SpotApi/IMexcClientSpotApi.cs index 78aebcd..b1d1de6 100644 --- a/src/Interfaces/Clients/SpotApi/IMexcClientSpotApi.cs +++ b/src/Interfaces/Clients/SpotApi/IMexcClientSpotApi.cs @@ -1,4 +1,6 @@ -using CryptoExchange.Net.Interfaces.CommonClients; +using System; +using CryptoExchange.Net.Interfaces; +using CryptoExchange.Net.Interfaces.CommonClients; using Mexc.Net.Objects.Models; namespace Mexc.Net.Interfaces.Clients.SpotApi; diff --git a/src/Interfaces/Clients/SpotApi/IMexcClientSpotApiAccount.cs b/src/Interfaces/Clients/SpotApi/IMexcClientSpotApiAccount.cs index 69589d1..a7136a4 100644 --- a/src/Interfaces/Clients/SpotApi/IMexcClientSpotApiAccount.cs +++ b/src/Interfaces/Clients/SpotApi/IMexcClientSpotApiAccount.cs @@ -1,4 +1,7 @@ -using Mexc.Net.Objects.Models; +using System.Threading; +using System.Threading.Tasks; +using CryptoExchange.Net.Objects; +using Mexc.Net.Objects.Models; namespace Mexc.Net.Interfaces.Clients.SpotApi; diff --git a/src/Interfaces/Clients/SpotApi/IMexcClientSpotApiExchangeData.cs b/src/Interfaces/Clients/SpotApi/IMexcClientSpotApiExchangeData.cs index 6eecbc4..6ff7c76 100644 --- a/src/Interfaces/Clients/SpotApi/IMexcClientSpotApiExchangeData.cs +++ b/src/Interfaces/Clients/SpotApi/IMexcClientSpotApiExchangeData.cs @@ -1,4 +1,9 @@ -using Mexc.Net.Enums; +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using CryptoExchange.Net.Objects; +using Mexc.Net.Enums; using Mexc.Net.Objects.Models; namespace Mexc.Net.Interfaces.Clients.SpotApi; diff --git a/src/Interfaces/Clients/SpotApi/IMexcClientSpotApiTrading.cs b/src/Interfaces/Clients/SpotApi/IMexcClientSpotApiTrading.cs index 8ca9541..ed07211 100644 --- a/src/Interfaces/Clients/SpotApi/IMexcClientSpotApiTrading.cs +++ b/src/Interfaces/Clients/SpotApi/IMexcClientSpotApiTrading.cs @@ -1,4 +1,8 @@ -using Mexc.Net.Enums; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using CryptoExchange.Net.Objects; +using Mexc.Net.Enums; using Mexc.Net.Objects.Models; namespace Mexc.Net.Interfaces.Clients.SpotApi; diff --git a/src/Interfaces/Clients/SpotApi/IMexcSocketClientSpotStreams.cs b/src/Interfaces/Clients/SpotApi/IMexcSocketClientSpotStreams.cs index 0ac0389..58b1e98 100644 --- a/src/Interfaces/Clients/SpotApi/IMexcSocketClientSpotStreams.cs +++ b/src/Interfaces/Clients/SpotApi/IMexcSocketClientSpotStreams.cs @@ -1,4 +1,10 @@ -using CryptoExchange.Net.Sockets; +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using CryptoExchange.Net.Interfaces; +using CryptoExchange.Net.Objects; +using CryptoExchange.Net.Sockets; using Mexc.Net.Enums; using Mexc.Net.Objects.Models.Spot.Socket; diff --git a/src/Interfaces/IMexcKline.cs b/src/Interfaces/IMexcKline.cs index ec5499e..d5f833a 100644 --- a/src/Interfaces/IMexcKline.cs +++ b/src/Interfaces/IMexcKline.cs @@ -1,4 +1,6 @@ -namespace Mexc.Net.Interfaces; +using System; + +namespace Mexc.Net.Interfaces; /// /// Kline data diff --git a/src/Interfaces/IMexcOrderBook.cs b/src/Interfaces/IMexcOrderBook.cs index 67e43b2..e18b0c4 100644 --- a/src/Interfaces/IMexcOrderBook.cs +++ b/src/Interfaces/IMexcOrderBook.cs @@ -1,4 +1,6 @@ -using Mexc.Net.Objects.Models; +using System; +using System.Collections.Generic; +using Mexc.Net.Objects.Models; namespace Mexc.Net.Interfaces; diff --git a/src/Interfaces/IMexcStreamKlineData.cs b/src/Interfaces/IMexcStreamKlineData.cs index fe1d277..9bee733 100644 --- a/src/Interfaces/IMexcStreamKlineData.cs +++ b/src/Interfaces/IMexcStreamKlineData.cs @@ -1,4 +1,5 @@ -using Mexc.Net.Enums; +using System; +using Mexc.Net.Enums; namespace Mexc.Net.Interfaces; diff --git a/src/Mexc.Net.csproj b/src/Mexc.Net.csproj index 3cbab82..4951fd1 100644 --- a/src/Mexc.Net.csproj +++ b/src/Mexc.Net.csproj @@ -1,16 +1,12 @@ - - net6.0 - enable - - - - - - - - - + + netstandard2.0;netstandard2.1 + latest + + + + + diff --git a/src/MexcAuthenticationProvider.cs b/src/MexcAuthenticationProvider.cs index e25012d..4c1d5c9 100644 --- a/src/MexcAuthenticationProvider.cs +++ b/src/MexcAuthenticationProvider.cs @@ -1,4 +1,10 @@ -using Mexc.Net.Objects; +using System; +using System.Collections.Generic; +using System.Net.Http; +using CryptoExchange.Net; +using CryptoExchange.Net.Authentication; +using CryptoExchange.Net.Objects; +using Mexc.Net.Objects; namespace Mexc.Net; diff --git a/src/MexcEnvironment.cs b/src/MexcEnvironment.cs index 180d318..6ee99f1 100644 --- a/src/MexcEnvironment.cs +++ b/src/MexcEnvironment.cs @@ -1,4 +1,5 @@ -using Mexc.Net.Objects; +using CryptoExchange.Net.Objects; +using Mexc.Net.Objects; namespace Mexc.Net { diff --git a/src/MexcHelpers.cs b/src/MexcHelpers.cs index 93875aa..c235390 100644 --- a/src/MexcHelpers.cs +++ b/src/MexcHelpers.cs @@ -1,10 +1,11 @@ -using Microsoft.Extensions.DependencyInjection; +using System; +using Microsoft.Extensions.DependencyInjection; using System.Net; +using System.Net.Http; +using System.Text.RegularExpressions; using Mexc.Net.Objects.Options; using Mexc.Net.Clients; using Mexc.Net.Interfaces.Clients; -using Mexc.Net.Interfaces.Clients.SpotApi; -using Mexc.Net.Clients.SpotApi; namespace Mexc.Net; @@ -22,7 +23,18 @@ internal static bool IsNotIn(this T @this, params T[] values) { return Array.IndexOf(values, @this) == -1; } + /// + /// Validate the string is a valid Mexc symbol. + /// + /// string to validate + public static void ValidateMexcSymbol(this string symbolString) + { + if (string.IsNullOrEmpty(symbolString)) + throw new ArgumentException("Symbol is not provided"); + if(!Regex.IsMatch(symbolString, "^([A-Z|a-z|0-9]{5,})$")) + throw new ArgumentException($"{symbolString} is not a valid Mexc symbol. Should be [BaseAsset][QuoteAsset], e.g. BTCUSDT"); + } /// /// Add the IMexcClient and IMexcSocketClient to the sevice collection so they can be injected /// diff --git a/src/Objects/Core/MexcRestApiError.cs b/src/Objects/Core/MexcRestApiError.cs index 7d85060..075d4d8 100644 --- a/src/Objects/Core/MexcRestApiError.cs +++ b/src/Objects/Core/MexcRestApiError.cs @@ -1,4 +1,6 @@ -namespace Mexc.Net.Objects.Core; +using CryptoExchange.Net.Objects; + +namespace Mexc.Net.Objects.Core; /// /// API error diff --git a/src/Objects/Core/MexcRestApiResponse.cs b/src/Objects/Core/MexcRestApiResponse.cs index 6b31011..376348b 100644 --- a/src/Objects/Core/MexcRestApiResponse.cs +++ b/src/Objects/Core/MexcRestApiResponse.cs @@ -1,4 +1,6 @@ -namespace Mexc.Net.Objects.Core; +using Newtonsoft.Json; + +namespace Mexc.Net.Objects.Core; /// /// Rest API response diff --git a/src/Objects/Core/MexcSocketRequests.cs b/src/Objects/Core/MexcSocketRequests.cs index ad0e113..5ca9cc6 100644 --- a/src/Objects/Core/MexcSocketRequests.cs +++ b/src/Objects/Core/MexcSocketRequests.cs @@ -1,5 +1,9 @@ -using Mexc.Net.Converters; +using System; +using System.Collections.Generic; +using CryptoExchange.Net.Converters; +using Mexc.Net.Converters; using Mexc.Net.Enums; +using Newtonsoft.Json; namespace Mexc.Net.Objects.Core; diff --git a/src/Objects/Core/MexcSocketResponses.cs b/src/Objects/Core/MexcSocketResponses.cs index 7ef3b23..acf8ff2 100644 --- a/src/Objects/Core/MexcSocketResponses.cs +++ b/src/Objects/Core/MexcSocketResponses.cs @@ -1,4 +1,6 @@ -namespace Mexc.Net.Objects.Core; +using Newtonsoft.Json; + +namespace Mexc.Net.Objects.Core; internal class MexcSocketResponse { diff --git a/src/Objects/Internal/MexcResult.cs b/src/Objects/Internal/MexcResult.cs index 8b74cdb..be51721 100644 --- a/src/Objects/Internal/MexcResult.cs +++ b/src/Objects/Internal/MexcResult.cs @@ -1,4 +1,6 @@ -namespace Mexc.Net.Objects.Internal; +using Newtonsoft.Json; + +namespace Mexc.Net.Objects.Internal; internal class MexcResult { diff --git a/src/Objects/Internal/MexcSocketRequest.cs b/src/Objects/Internal/MexcSocketRequest.cs index 6679fff..a2919b7 100644 --- a/src/Objects/Internal/MexcSocketRequest.cs +++ b/src/Objects/Internal/MexcSocketRequest.cs @@ -1,4 +1,7 @@ -namespace Mexc.Net.Objects.Internal; +using System; +using Newtonsoft.Json; + +namespace Mexc.Net.Objects.Internal; internal class MexcSocketRequest { diff --git a/src/Objects/MexcApiCredentials.cs b/src/Objects/MexcApiCredentials.cs index ad5e1ae..ef7dfb4 100644 --- a/src/Objects/MexcApiCredentials.cs +++ b/src/Objects/MexcApiCredentials.cs @@ -1,4 +1,9 @@ -using System.Text; +using System.IO; +using System.Security; +using System.Text; +using CryptoExchange.Net; +using CryptoExchange.Net.Authentication; +using Newtonsoft.Json.Linq; namespace Mexc.Net.Objects; diff --git a/src/Objects/Models/Mexc24HPrice.cs b/src/Objects/Models/Mexc24HPrice.cs index 980c1d9..d1ee366 100644 --- a/src/Objects/Models/Mexc24HPrice.cs +++ b/src/Objects/Models/Mexc24HPrice.cs @@ -1,4 +1,5 @@ using Mexc.Net.Interfaces.Clients; +using Newtonsoft.Json; namespace Mexc.Net.Objects.Models; diff --git a/src/Objects/Models/Mexc24HPriceBase.cs b/src/Objects/Models/Mexc24HPriceBase.cs index 1b28611..efb1ade 100644 --- a/src/Objects/Models/Mexc24HPriceBase.cs +++ b/src/Objects/Models/Mexc24HPriceBase.cs @@ -1,4 +1,7 @@ -using Mexc.Net.Interfaces.Clients; +using System; +using CryptoExchange.Net.Converters; +using Mexc.Net.Interfaces.Clients; +using Newtonsoft.Json; namespace Mexc.Net.Objects.Models; diff --git a/src/Objects/Models/MexcAccountInfo.cs b/src/Objects/Models/MexcAccountInfo.cs index 301b7c0..f393e43 100644 --- a/src/Objects/Models/MexcAccountInfo.cs +++ b/src/Objects/Models/MexcAccountInfo.cs @@ -1,4 +1,8 @@ -using Mexc.Net.Enums; +using System; +using System.Collections.Generic; +using CryptoExchange.Net.Converters; +using Mexc.Net.Enums; +using Newtonsoft.Json; namespace Mexc.Net.Objects.Models; diff --git a/src/Objects/Models/MexcAveragePrice.cs b/src/Objects/Models/MexcAveragePrice.cs index 9161a5d..3a5f66d 100644 --- a/src/Objects/Models/MexcAveragePrice.cs +++ b/src/Objects/Models/MexcAveragePrice.cs @@ -1,4 +1,6 @@ -namespace Mexc.Net.Objects.Models; +using Newtonsoft.Json; + +namespace Mexc.Net.Objects.Models; /// /// Current average price details for a symbol. diff --git a/src/Objects/Models/MexcCheckTime.cs b/src/Objects/Models/MexcCheckTime.cs index 8375945..bfbced9 100644 --- a/src/Objects/Models/MexcCheckTime.cs +++ b/src/Objects/Models/MexcCheckTime.cs @@ -1,4 +1,8 @@ -namespace Mexc.Net.Objects.Models; +using System; +using CryptoExchange.Net.Converters; +using Newtonsoft.Json; + +namespace Mexc.Net.Objects.Models; public class MexcCheckTime { diff --git a/src/Objects/Models/MexcCombinedStream.cs b/src/Objects/Models/MexcCombinedStream.cs index 78bef86..edd7fbd 100644 --- a/src/Objects/Models/MexcCombinedStream.cs +++ b/src/Objects/Models/MexcCombinedStream.cs @@ -1,4 +1,8 @@ -namespace Mexc.Net.Objects.Models; +using System; +using CryptoExchange.Net.Converters; +using Newtonsoft.Json; + +namespace Mexc.Net.Objects.Models; public class MexcCombinedStream { diff --git a/src/Objects/Models/MexcExchangeInfo.cs b/src/Objects/Models/MexcExchangeInfo.cs index a560d88..44b3321 100644 --- a/src/Objects/Models/MexcExchangeInfo.cs +++ b/src/Objects/Models/MexcExchangeInfo.cs @@ -1,4 +1,9 @@ -namespace Mexc.Net.Objects.Models; +using System; +using System.Collections.Generic; +using CryptoExchange.Net.Converters; +using Newtonsoft.Json; + +namespace Mexc.Net.Objects.Models; /// /// Exchange info diff --git a/src/Objects/Models/MexcKline.cs b/src/Objects/Models/MexcKline.cs index 2733404..a25217f 100644 --- a/src/Objects/Models/MexcKline.cs +++ b/src/Objects/Models/MexcKline.cs @@ -1,4 +1,8 @@ -namespace Mexc.Net.Objects.Models; +using System; +using CryptoExchange.Net.Converters; +using Newtonsoft.Json; + +namespace Mexc.Net.Objects.Models; /// /// Kline info diff --git a/src/Objects/Models/MexcKlineBase.cs b/src/Objects/Models/MexcKlineBase.cs index 4edb0cf..00a498b 100644 --- a/src/Objects/Models/MexcKlineBase.cs +++ b/src/Objects/Models/MexcKlineBase.cs @@ -1,6 +1,9 @@ -using Mexc.Net.Converters; +using System; +using CryptoExchange.Net.Converters; +using Mexc.Net.Converters; using Mexc.Net.Enums; using Mexc.Net.Interfaces; +using Newtonsoft.Json; namespace Mexc.Net.Objects.Models; diff --git a/src/Objects/Models/MexcOrderBase.cs b/src/Objects/Models/MexcOrderBase.cs index bf48ff1..98bbbaa 100644 --- a/src/Objects/Models/MexcOrderBase.cs +++ b/src/Objects/Models/MexcOrderBase.cs @@ -1,5 +1,8 @@ -using Mexc.Net.Converters; +using System; +using CryptoExchange.Net.Converters; +using Mexc.Net.Converters; using Mexc.Net.Enums; +using Newtonsoft.Json; namespace Mexc.Net.Objects.Models; diff --git a/src/Objects/Models/MexcOrderBook.cs b/src/Objects/Models/MexcOrderBook.cs index 59ec989..9bb50ff 100644 --- a/src/Objects/Models/MexcOrderBook.cs +++ b/src/Objects/Models/MexcOrderBook.cs @@ -1,4 +1,7 @@ -using Mexc.Net.Interfaces; +using System; +using System.Collections.Generic; +using Mexc.Net.Interfaces; +using Newtonsoft.Json; namespace Mexc.Net.Objects.Models; diff --git a/src/Objects/Models/MexcOrderBookEntry.cs b/src/Objects/Models/MexcOrderBookEntry.cs index 9044b18..a221e84 100644 --- a/src/Objects/Models/MexcOrderBookEntry.cs +++ b/src/Objects/Models/MexcOrderBookEntry.cs @@ -1,4 +1,8 @@ -namespace Mexc.Net.Objects.Models; +using CryptoExchange.Net.Converters; +using CryptoExchange.Net.Interfaces; +using Newtonsoft.Json; + +namespace Mexc.Net.Objects.Models; /// /// An entry in the order book diff --git a/src/Objects/Models/MexcPlacedOrder.cs b/src/Objects/Models/MexcPlacedOrder.cs index 6de7088..fe0a0a0 100644 --- a/src/Objects/Models/MexcPlacedOrder.cs +++ b/src/Objects/Models/MexcPlacedOrder.cs @@ -1,4 +1,8 @@ -namespace Mexc.Net.Objects.Models; +using System; +using CryptoExchange.Net.Converters; +using Newtonsoft.Json; + +namespace Mexc.Net.Objects.Models; public class MexcPlacedOrder : MexcOrderBase { diff --git a/src/Objects/Models/MexcRateLimit.cs b/src/Objects/Models/MexcRateLimit.cs index a0f4a31..c5b0d0e 100644 --- a/src/Objects/Models/MexcRateLimit.cs +++ b/src/Objects/Models/MexcRateLimit.cs @@ -1,5 +1,6 @@ using Mexc.Net.Converters; using Mexc.Net.Enums; +using Newtonsoft.Json; namespace Mexc.Net.Objects.Models; diff --git a/src/Objects/Models/MexcStreamEvent.cs b/src/Objects/Models/MexcStreamEvent.cs index df0a6d2..6afdb06 100644 --- a/src/Objects/Models/MexcStreamEvent.cs +++ b/src/Objects/Models/MexcStreamEvent.cs @@ -1,4 +1,8 @@ -namespace Mexc.Net.Objects.Models; +using System; +using CryptoExchange.Net.Converters; +using Newtonsoft.Json; + +namespace Mexc.Net.Objects.Models; public class MexcStreamEvent { diff --git a/src/Objects/Models/MexcSymbol.cs b/src/Objects/Models/MexcSymbol.cs index 3b7f46b..8464738 100644 --- a/src/Objects/Models/MexcSymbol.cs +++ b/src/Objects/Models/MexcSymbol.cs @@ -1,5 +1,9 @@ -using Mexc.Net.Converters; +using System; +using System.Collections.Generic; +using CryptoExchange.Net.Converters; +using Mexc.Net.Converters; using Mexc.Net.Enums; +using Newtonsoft.Json; namespace Mexc.Net.Objects.Models; diff --git a/src/Objects/Models/MexcSymbolFilter.cs b/src/Objects/Models/MexcSymbolFilter.cs index ef32856..206c1b7 100644 --- a/src/Objects/Models/MexcSymbolFilter.cs +++ b/src/Objects/Models/MexcSymbolFilter.cs @@ -1,5 +1,6 @@ using Mexc.Net.Converters; using Mexc.Net.Enums; +using Newtonsoft.Json; namespace Mexc.Net.Objects.Models; diff --git a/src/Objects/Models/Spot/Socket/MexcSpotKline.cs b/src/Objects/Models/Spot/Socket/MexcSpotKline.cs index f3fb2b5..b807d05 100644 --- a/src/Objects/Models/Spot/Socket/MexcSpotKline.cs +++ b/src/Objects/Models/Spot/Socket/MexcSpotKline.cs @@ -1,4 +1,7 @@ -namespace Mexc.Net.Objects.Models.Spot.Socket; +using CryptoExchange.Net.Converters; +using Newtonsoft.Json; + +namespace Mexc.Net.Objects.Models.Spot.Socket; /// /// Candlestick information for symbol diff --git a/src/Objects/Models/Spot/Socket/MexcStreamKline.cs b/src/Objects/Models/Spot/Socket/MexcStreamKline.cs index 45bc290..ce667d7 100644 --- a/src/Objects/Models/Spot/Socket/MexcStreamKline.cs +++ b/src/Objects/Models/Spot/Socket/MexcStreamKline.cs @@ -1,6 +1,9 @@ -using Mexc.Net.Converters; +using System; +using CryptoExchange.Net.Converters; +using Mexc.Net.Converters; using Mexc.Net.Enums; using Mexc.Net.Interfaces; +using Newtonsoft.Json; namespace Mexc.Net.Objects.Models.Spot.Socket; diff --git a/src/Objects/Models/Spot/Socket/MexcStreamTrade.cs b/src/Objects/Models/Spot/Socket/MexcStreamTrade.cs index bef83ed..dc4d751 100644 --- a/src/Objects/Models/Spot/Socket/MexcStreamTrade.cs +++ b/src/Objects/Models/Spot/Socket/MexcStreamTrade.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Mexc.Net.Objects.Models.Spot.Socket; +namespace Mexc.Net.Objects.Models.Spot.Socket; public class MexcStreamTrade { diff --git a/src/Objects/Options/MexcRestOptions.cs b/src/Objects/Options/MexcRestOptions.cs index 4442d22..6e39611 100644 --- a/src/Objects/Options/MexcRestOptions.cs +++ b/src/Objects/Options/MexcRestOptions.cs @@ -1,5 +1,5 @@ -using CryptoExchange.Net.Objects.Options; -using Mexc.Net; +using System; +using CryptoExchange.Net.Objects.Options; namespace Mexc.Net.Objects.Options; @@ -16,6 +16,11 @@ public class MexcRestOptions : RestExchangeOptions + /// The default receive window for requests + /// + public TimeSpan ReceiveWindow { get; set; } = TimeSpan.FromSeconds(5); + /// /// Whether or not to sign public requests /// diff --git a/src/Objects/Options/MexcSocketOptions.cs b/src/Objects/Options/MexcSocketOptions.cs index abbb570..185c3f0 100644 --- a/src/Objects/Options/MexcSocketOptions.cs +++ b/src/Objects/Options/MexcSocketOptions.cs @@ -1,5 +1,4 @@ using CryptoExchange.Net.Objects.Options; -using Mexc.Net; namespace Mexc.Net.Objects.Options; diff --git a/src/Usings.cs b/src/Usings.cs deleted file mode 100644 index eaf6c23..0000000 --- a/src/Usings.cs +++ /dev/null @@ -1,17 +0,0 @@ -global using CryptoExchange.Net; -global using CryptoExchange.Net.Authentication; -global using CryptoExchange.Net.Converters; -global using CryptoExchange.Net.Interfaces; -global using CryptoExchange.Net.Objects; -global using Microsoft.Extensions.Logging; -global using Newtonsoft.Json; -global using Newtonsoft.Json.Linq; -global using Newtonsoft.Json.Serialization; -global using System; -global using System.Collections.Generic; -global using System.Globalization; -global using System.Linq; -global using System.Net.Http; -global using System.Security; -global using System.Threading; -global using System.Threading.Tasks; \ No newline at end of file