File tree 4 files changed +18
-17
lines changed
src/ExchangeSharp/API/Exchanges/_Base
4 files changed +18
-17
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ The following cryptocurrency services are supported:
75
75
76
76
Exchange constructors are private, to get access to an exchange in code use:
77
77
78
- ` ExchangeAPI.GetExchangeAPIAsync<>() ` .
78
+ ` ExchangeAPI.GetExchangeAPIAsync<T >() ` .
79
79
80
80
### Installing the CLI
81
81
Original file line number Diff line number Diff line change @@ -605,19 +605,20 @@ public static Task<IExchangeAPI> GetExchangeAPIAsync(string exchangeName)
605
605
/// <typeparam name="T">Type of exchange to get</typeparam>
606
606
/// <returns>Exchange API or null if not found</returns>
607
607
[ Obsolete ( "Use the async version" ) ]
608
- public static IExchangeAPI GetExchangeAPI < T > ( )
608
+ public static T GetExchangeAPI < T > ( )
609
609
where T : ExchangeAPI
610
610
{
611
611
return GetExchangeAPIAsync < T > ( ) . Result ;
612
612
}
613
613
614
- public static Task < IExchangeAPI > GetExchangeAPIAsync < T > ( )
614
+ public static async Task < T > GetExchangeAPIAsync < T > ( )
615
615
where T : ExchangeAPI
616
616
{
617
617
// note: this method will be slightly slow (milliseconds) the first time it is called due to cache miss and initialization
618
618
// subsequent calls with cache hits will be nanoseconds
619
619
Type type = typeof ( T ) ! ;
620
- return GetExchangeAPIAsync ( type ) ;
620
+
621
+ return ( T ) await GetExchangeAPIAsync ( type ) ;
621
622
}
622
623
623
624
/// <summary>
Original file line number Diff line number Diff line change @@ -34,22 +34,22 @@ public void DeserializeDiff()
34
34
string toParse =
35
35
@"{
36
36
""e"": ""depthUpdate"",
37
- ""E"": 123456789,
38
- ""s"": ""BNBBTC"",
39
- ""U"": 157,
40
- ""u"": 160,
41
- ""b"": [
37
+ ""E"": 123456789,
38
+ ""s"": ""BNBBTC"",
39
+ ""U"": 157,
40
+ ""u"": 160,
41
+ ""b"": [
42
42
[
43
- ""0.0024"",
43
+ ""0.0024"",
44
44
""10"",
45
- []
45
+ []
46
46
]
47
47
],
48
- ""a"": [
48
+ ""a"": [
49
49
[
50
- ""0.0026"",
51
- ""100"",
52
- []
50
+ ""0.0026"",
51
+ ""100"",
52
+ []
53
53
]
54
54
]
55
55
}" ;
@@ -116,7 +116,7 @@ public async Task CurrenciesParsedCorrectly()
116
116
requestMaker
117
117
. MakeRequestAsync (
118
118
"/capital/config/getall" ,
119
- ( ( ExchangeBinanceAPI ) binance ) . BaseUrlSApi
119
+ binance . BaseUrlSApi
120
120
)
121
121
. Returns (
122
122
new IAPIRequestMaker . RequestResult < string > ( )
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ namespace ExchangeSharpTests;
11
11
public class MEXCAPITests
12
12
{
13
13
private const string MarketSymbol = "ETHBTC" ;
14
- private static IExchangeAPI _api ;
14
+ private static ExchangeMEXCAPI _api ;
15
15
16
16
[ AssemblyInitialize ]
17
17
public static async Task AssemblyInitialize ( TestContext testContext )
You can’t perform that action at this time.
0 commit comments