Skip to content

Commit 9545f6c

Browse files
authored
MEXC: Add base and quote precision (#861)
1 parent 2e68817 commit 9545f6c

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/ExchangeSharp/API/Exchanges/MEXC/ExchangeMEXCAPI.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Generic;
33
using System.Linq;
44
using System.Threading.Tasks;
5+
using ExchangeSharp.Models;
56
using Newtonsoft.Json.Linq;
67

78
namespace ExchangeSharp
@@ -51,13 +52,15 @@ protected internal override async Task<IEnumerable<ExchangeMarket>> OnGetMarketS
5152
var symbols = await MakeJsonRequestAsync<JToken>("/exchangeInfo", BaseUrl);
5253

5354
return (symbols["symbols"] ?? throw new ArgumentNullException())
54-
.Select(symbol => new ExchangeMarket()
55+
.Select(symbol => new ExchangeMarketMexc()
5556
{
5657
MarketSymbol = symbol["symbol"].ToStringInvariant(),
5758
IsActive = symbol["isSpotTradingAllowed"].ConvertInvariant<bool>(),
5859
MarginEnabled = symbol["isMarginTradingAllowed"].ConvertInvariant<bool>(),
5960
BaseCurrency = symbol["baseAsset"].ToStringInvariant(),
6061
QuoteCurrency = symbol["quoteAsset"].ToStringInvariant(),
62+
BaseAssetPrecision = symbol["baseAssetPrecision"].ConvertInvariant<int>(),
63+
QuoteAssetPrecision = symbol["quoteAssetPrecision"].ConvertInvariant<int>(),
6164
QuantityStepSize = symbol["baseSizePrecision"].ConvertInvariant<decimal>(),
6265
// Not 100% sure about this
6366
PriceStepSize =
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace ExchangeSharp.Models
2+
{
3+
public class ExchangeMarketMexc : ExchangeMarket
4+
{
5+
public int BaseAssetPrecision { get; set; }
6+
public int QuoteAssetPrecision { get; set; }
7+
}
8+
}

0 commit comments

Comments
 (0)