@@ -68,29 +68,14 @@ public interface IExchangeAPI : IDisposable, IBaseAPI, IOrderBookProvider
68
68
69
69
#endregion Utility Methods
70
70
71
- #region REST
71
+ #region REST API
72
72
73
73
/// <summary>
74
74
/// Gets currencies and related data such as IsEnabled and TxFee (if available)
75
75
/// </summary>
76
76
/// <returns>Collection of Currencies</returns>
77
77
Task < IReadOnlyDictionary < string , ExchangeCurrency > > GetCurrenciesAsync ( ) ;
78
78
79
- /// <summary>
80
- /// Gets the address to deposit to and applicable details.
81
- /// </summary>
82
- /// <param name="currency">Currency to get address for.</param>
83
- /// <param name="forceRegenerate">True to regenerate the address</param>
84
- /// <returns>Deposit address details (including tag if applicable, such as XRP)</returns>
85
- Task < ExchangeDepositDetails > GetDepositAddressAsync ( string currency , bool forceRegenerate = false ) ;
86
-
87
- /// <summary>
88
- /// Gets the deposit history for a currency
89
- /// </summary>
90
- /// <param name="currency">The currency to check. May be null.</param>
91
- /// <returns>Collection of ExchangeCoinTransfers</returns>
92
- Task < IEnumerable < ExchangeTransaction > > GetDepositHistoryAsync ( string currency ) ;
93
-
94
79
/// <summary>
95
80
/// Get symbols for the exchange markets
96
81
/// </summary>
@@ -109,6 +94,29 @@ public interface IExchangeAPI : IDisposable, IBaseAPI, IOrderBookProvider
109
94
/// <returns>Collection of ExchangeMarkets</returns>
110
95
Task < IEnumerable < ExchangeMarket > > GetMarketSymbolsMetadataAsync ( ) ;
111
96
97
+ /// <summary>
98
+ /// Gets the exchange market from this exchange's SymbolsMetadata cache. This will make a network request if needed to retrieve fresh markets from the exchange using GetSymbolsMetadataAsync().
99
+ /// Please note that sending a symbol that is not found over and over will result in many network requests. Only send symbols that you are confident exist on the exchange.
100
+ /// </summary>
101
+ /// <param name="marketSymbol">The market symbol. Ex. ADA/BTC. This is assumed to be normalized and already correct for the exchange.</param>
102
+ /// <returns>The ExchangeMarket or null if it doesn't exist in the cache or there was an error</returns>
103
+ Task < ExchangeMarket ? > GetExchangeMarketFromCacheAsync ( string marketSymbol ) ;
104
+
105
+ /// <summary>
106
+ /// Gets the address to deposit to and applicable details.
107
+ /// </summary>
108
+ /// <param name="currency">Currency to get address for.</param>
109
+ /// <param name="forceRegenerate">True to regenerate the address</param>
110
+ /// <returns>Deposit address details (including tag if applicable, such as XRP)</returns>
111
+ Task < ExchangeDepositDetails > GetDepositAddressAsync ( string currency , bool forceRegenerate = false ) ;
112
+
113
+ /// <summary>
114
+ /// Gets the deposit history for a currency
115
+ /// </summary>
116
+ /// <param name="currency">The currency to check. May be null.</param>
117
+ /// <returns>Collection of ExchangeCoinTransfers</returns>
118
+ Task < IEnumerable < ExchangeTransaction > > GetDepositHistoryAsync ( string currency ) ;
119
+
112
120
/// <summary>
113
121
/// Get latest ticker
114
122
/// </summary>
@@ -132,6 +140,10 @@ public interface IExchangeAPI : IDisposable, IBaseAPI, IOrderBookProvider
132
140
Task GetHistoricalTradesAsync ( Func < IEnumerable < ExchangeTrade > , bool > callback , string marketSymbol , DateTime ? startDate = null , DateTime ? endDate = null , int ? limit = null ) ;
133
141
//Task GetHistoricalTradesAsync(Func<IEnumerable<ExchangeTrade>, bool> callback, string marketSymbol, DateTime? startDate = null, DateTime? endDate = null);
134
142
143
+ // Task<ExchangeOrderBook> GetOrderBookAsync(string marketSymbol, int maxCount = 100); is in IOrderBookProvider
144
+
145
+ // Task<IEnumerable<KeyValuePair<string, ExchangeOrderBook>>> GetOrderBooksAsync(int maxCount = 100); is in IOrderBookProvider
146
+
135
147
/// <summary>
136
148
/// Get the latest trades
137
149
/// </summary>
@@ -151,6 +163,12 @@ public interface IExchangeAPI : IDisposable, IBaseAPI, IOrderBookProvider
151
163
/// <returns>Candles</returns>
152
164
Task < IEnumerable < MarketCandle > > GetCandlesAsync ( string marketSymbol , int periodSeconds , DateTime ? startDate = null , DateTime ? endDate = null , int ? limit = null ) ;
153
165
166
+ /// <summary>
167
+ /// Get fees
168
+ /// </summary>
169
+ /// <returns>The customer trading fees</returns>
170
+ Task < Dictionary < string , decimal > > GetFeesAync ( ) ;
171
+
154
172
/// <summary>
155
173
/// Get total amounts, symbol / amount dictionary
156
174
/// </summary>
@@ -163,6 +181,13 @@ public interface IExchangeAPI : IDisposable, IBaseAPI, IOrderBookProvider
163
181
/// <returns>Dictionary of symbols and amounts available to trade</returns>
164
182
Task < Dictionary < string , decimal > > GetAmountsAvailableToTradeAsync ( ) ;
165
183
184
+ /// <summary>
185
+ /// Get margin amounts available to trade, symbol / amount dictionary
186
+ /// </summary>
187
+ /// <param name="includeZeroBalances">Include currencies with zero balance in return value</param>
188
+ /// <returns>Dictionary of symbols and amounts available to trade in margin account</returns>
189
+ Task < Dictionary < string , decimal > > GetMarginAmountsAvailableToTradeAsync ( bool includeZeroBalances = false ) ;
190
+
166
191
/// <summary>
167
192
/// Place an order
168
193
/// </summary>
@@ -208,11 +233,16 @@ public interface IExchangeAPI : IDisposable, IBaseAPI, IOrderBookProvider
208
233
Task CancelOrderAsync ( string orderId , string ? marketSymbol = null ) ;
209
234
210
235
/// <summary>
211
- /// Get margin amounts available to trade, symbol / amount dictionary
236
+ /// Asynchronous withdraws request.
212
237
/// </summary>
213
- /// <param name="includeZeroBalances">Include currencies with zero balance in return value</param>
214
- /// <returns>Dictionary of symbols and amounts available to trade in margin account</returns>
215
- Task < Dictionary < string , decimal > > GetMarginAmountsAvailableToTradeAsync ( bool includeZeroBalances = false ) ;
238
+ /// <param name="withdrawalRequest">The withdrawal request.</param>
239
+ Task < ExchangeWithdrawalResponse > WithdrawAsync ( ExchangeWithdrawalRequest withdrawalRequest ) ;
240
+
241
+ /// <summary>
242
+ /// Gets the withdraw history for a symbol
243
+ /// </summary>
244
+ /// <returns>Collection of ExchangeCoinTransfers</returns>
245
+ Task < IEnumerable < ExchangeTransaction > > GetWithdrawHistoryAsync ( string currency ) ;
216
246
217
247
/// <summary>
218
248
/// Get open margin position
@@ -228,15 +258,9 @@ public interface IExchangeAPI : IDisposable, IBaseAPI, IOrderBookProvider
228
258
/// <returns>Close margin position result</returns>
229
259
Task < ExchangeCloseMarginPositionResult > CloseMarginPositionAsync ( string marketSymbol ) ;
230
260
231
- /// <summary>
232
- /// Get fees
233
- /// </summary>
234
- /// <returns>The customer trading fees</returns>
235
- Task < Dictionary < string , decimal > > GetFeesAync ( ) ;
236
-
237
261
#endregion REST
238
262
239
- #region Web Socket
263
+ #region Web Socket API
240
264
/// <summary>
241
265
/// Gets Candles (OHLC) websocket
242
266
/// </summary>
@@ -285,6 +309,12 @@ public interface IExchangeAPI : IDisposable, IBaseAPI, IOrderBookProvider
285
309
/// <returns>Web socket, call Dispose to close</returns>
286
310
Task < IWebSocket > GetCompletedOrderDetailsWebSocketAsync ( Action < ExchangeOrderResult > callback ) ;
287
311
312
+ /// <summary>
313
+ /// Get user detail over web socket
314
+ /// </summary>
315
+ /// <param name="callback">Callback</param>
316
+ /// <param name="listenKey">Listen key</param>
317
+ /// <returns>Web socket, call Dispose to close</returns>
288
318
Task < IWebSocket > GetUserDataWebSocketAsync ( Action < object > callback , string listenKey ) ;
289
319
#endregion Web Socket
290
320
}
0 commit comments