using CryptoExchange.Net.CommonObjects;
using CryptoExchange.Net.Objects;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace CryptoExchange.Net.Interfaces.CommonClients
{
///
/// Common rest client endpoints
///
public interface IBaseRestClient
{
///
/// The name of the exchange
///
string ExchangeName { get; }
///
/// Should be triggered on order placing
///
event Action OnOrderPlaced;
///
/// Should be triggered on order cancelling
///
event Action OnOrderCanceled;
///
/// Get the symbol name based on a base and quote asset
///
/// The base asset
/// The quote asset
///
string GetSymbolName(string baseAsset, string quoteAsset);
///
/// Get a list of symbols for the exchange
///
/// [Optional] Cancellation token for cancelling the request
///
Task>> GetSymbolsAsync(CancellationToken ct = default);
///
/// Get a ticker for the exchange
///
/// The symbol to get klines for
/// [Optional] Cancellation token for cancelling the request
///
Task> GetTickerAsync(string symbol, CancellationToken ct = default);
///
/// Get a list of tickers for the exchange
///
/// [Optional] Cancellation token for cancelling the request
///
Task>> GetTickersAsync(CancellationToken ct = default);
///
/// Get a list of candles for a given symbol on the exchange
///
/// The symbol to retrieve the candles for
/// The timespan to retrieve the candles for. The supported value are dependent on the exchange
/// [Optional] Start time to retrieve klines for
/// [Optional] End time to retrieve klines for
/// [Optional] Max number of results
/// [Optional] Cancellation token for cancelling the request
///
Task>> GetKlinesAsync(string symbol, TimeSpan timespan, DateTime? startTime = null, DateTime? endTime = null, int? limit = null, CancellationToken ct = default);
///
/// Get the order book for a symbol
///
/// The symbol to get the book for
/// [Optional] Cancellation token for cancelling the request
///
Task> GetOrderBookAsync(string symbol, CancellationToken ct = default);
///
/// The recent trades for a symbol
///
/// The symbol to get the trades for
/// [Optional] Cancellation token for cancelling the request
///
Task>> GetRecentTradesAsync(string symbol, CancellationToken ct = default);
///
/// Get balances
///
/// [Optional] The account id to retrieve balances for, required for some exchanges, ignored otherwise
/// [Optional] Cancellation token for cancelling the request
///
Task>> GetBalancesAsync(string? accountId = null, CancellationToken ct = default);
///
/// Get an order by id
///
/// The id
/// [Optional] The symbol the order is on, required for some exchanges, ignored otherwise
/// [Optional] Cancellation token for cancelling the request
///
Task> GetOrderAsync(string orderId, string? symbol = null, CancellationToken ct = default);
///
/// Get trades for an order by id
///
/// The id
/// [Optional] The symbol the order is on, required for some exchanges, ignored otherwise
/// [Optional] Cancellation token for cancelling the request
///
Task>> GetOrderTradesAsync(string orderId, string? symbol = null, CancellationToken ct = default);
///
/// Get a list of open orders
///
/// [Optional] The symbol to get open orders for, required for some exchanges, ignored otherwise
/// [Optional] Cancellation token for cancelling the request
///
Task>> GetOpenOrdersAsync(string? symbol = null, CancellationToken ct = default);
///
/// Get a list of closed orders
///
/// [Optional] The symbol to get closed orders for, required for some exchanges, ignored otherwise
/// [Optional] Cancellation token for cancelling the request
///
Task>> GetClosedOrdersAsync(string? symbol = null, CancellationToken ct = default);
///
/// Cancel an order by id
///
/// The id
/// [Optional] The symbol the order is on, required for some exchanges, ignored otherwise
/// [Optional] Cancellation token for cancelling the request
///
Task> CancelOrderAsync(string orderId, string? symbol = null, CancellationToken ct = default);
}
}