File tree Expand file tree Collapse file tree
src/ExchangeSharp/API/Exchanges/BitMEX Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ The above copyright notice and this permission notice shall be included in all c
1212
1313using System ;
1414using System . Collections . Generic ;
15+ using System . IO ;
1516using System . Linq ;
1617using System . Net ;
1718using System . Text ;
@@ -52,11 +53,32 @@ private ExchangeBitMEXAPI()
5253 RateLimit = new RateGate ( 300 , TimeSpan . FromMinutes ( 5 ) ) ;
5354 }
5455
55- public override Task < string > ExchangeMarketSymbolToGlobalMarketSymbolAsync (
56+ public override async Task < string > ExchangeMarketSymbolToGlobalMarketSymbolAsync (
5657 string marketSymbol
5758 )
5859 {
59- throw new NotImplementedException ( ) ;
60+ ExchangeMarket marketSymbolMetadata = await GetExchangeMarketFromCacheAsync (
61+ marketSymbol
62+ ) ;
63+ if ( marketSymbolMetadata == null )
64+ {
65+ throw new InvalidDataException (
66+ $ "No market symbol metadata returned or unable to find symbol metadata for { marketSymbol } "
67+ ) ;
68+ }
69+
70+ if ( marketSymbolMetadata . BaseCurrency == "XBT" )
71+ {
72+ marketSymbolMetadata . BaseCurrency = "BTC" ;
73+ }
74+
75+ if ( marketSymbolMetadata . QuoteCurrency == "XBT" )
76+ {
77+ marketSymbolMetadata . QuoteCurrency = "BTC" ;
78+ }
79+
80+ return await ExchangeMarketSymbolToGlobalMarketSymbolWithSeparatorAsync (
81+ marketSymbolMetadata . BaseCurrency + GlobalMarketSymbolSeparator + marketSymbolMetadata . QuoteCurrency ) ;
6082 }
6183
6284 public override Task < string > GlobalMarketSymbolToExchangeMarketSymbolAsync (
You can’t perform that action at this time.
0 commit comments