Skip to content

Commit c7bd6df

Browse files
authored
Add missing properties from BaseAPI to IBaseAPI (#632)
1 parent fd6d33f commit c7bd6df

File tree

1 file changed

+56
-26
lines changed

1 file changed

+56
-26
lines changed

src/ExchangeSharp/API/Common/IBaseAPI.cs

Lines changed: 56 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,27 @@ namespace ExchangeSharp
3131
/// <summary>
3232
/// Base interface for all API implementations
3333
/// </summary>
34-
public interface IBaseAPI : INamed
35-
{
36-
#region Properties
34+
public interface IBaseAPI : IAPIRequestHandler, INamed
35+
{
36+
#region Properties
37+
// BaseUrl is in IAPIRequestHandler
3738

38-
/// <summary>
39-
/// Optional public API key
40-
/// </summary>
41-
SecureString? PublicApiKey { get; set; }
39+
/// <summary>
40+
/// Base URL for the API for web sockets
41+
/// </summary>
42+
string BaseUrlWebSocket { get; set; }
43+
44+
/// <summary>
45+
/// Base URL for the private API for web sockets
46+
/// </summary>
47+
string BaseUrlPrivateWebSocket { get; set; }
48+
49+
// Name is in INamed
50+
51+
/// <summary>
52+
/// Optional public API key
53+
/// </summary>
54+
SecureString? PublicApiKey { get; set; }
4255

4356
/// <summary>
4457
/// Optional private API key
@@ -51,10 +64,9 @@ public interface IBaseAPI : INamed
5164
/// </summary>
5265
System.Security.SecureString? Passphrase { get; set; }
5366

54-
/// <summary>
55-
/// Request timeout
56-
/// </summary>
57-
TimeSpan RequestTimeout { get; set; }
67+
// RateLimit is in IAPIRequestHandler
68+
69+
// RequestTimeout is in IAPIRequestHandler
5870

5971
/// <summary>
6072
/// Request window - most services do not use this, but Binance API is an example of one that does
@@ -66,25 +78,43 @@ public interface IBaseAPI : INamed
6678
/// </summary>
6779
NonceStyle NonceStyle { get; }
6880

69-
/// <summary>
70-
/// Cache policy - defaults to no cache, don't change unless you have specific needs
71-
/// </summary>
72-
System.Net.Cache.RequestCachePolicy RequestCachePolicy { get; set; }
81+
/// <summary>
82+
/// The nonce end point for pulling down a server timestamp - override OnGetNonceOffset if you need custom handling
83+
/// </summary>
84+
string? NonceEndPoint { get; }
7385

74-
/// <summary>
75-
/// Cache policy for api methods (method name, cache time)
76-
/// </summary>
77-
Dictionary<string, TimeSpan> MethodCachePolicy { get; }
86+
/// <summary>
87+
/// The field in the json returned by the nonce end point to parse out - override OnGetNonceOffset if you need custom handling
88+
/// </summary>
89+
string? NonceEndPointField { get; }
7890

79-
#endregion Properties
91+
/// <summary>
92+
/// The type of value in the nonce end point field - override OnGetNonceOffset if you need custom handling.
93+
/// Supported values are Iso8601 and UnixMilliseconds.
94+
/// </summary>
95+
NonceStyle NonceEndPointStyle { get; }
8096

81-
#region Methods
97+
// RequestCachePolicy is in IAPIRequestHandler
8298

83-
/// <summary>
84-
/// Load API keys from an encrypted file - keys will stay encrypted in memory
85-
/// </summary>
86-
/// <param name="encryptedFile">Encrypted file to load keys from</param>
87-
void LoadAPIKeys(string encryptedFile);
99+
/// <summary>
100+
/// Cache policy for api methods (method name, cache time)
101+
/// </summary>
102+
Dictionary<string, TimeSpan> MethodCachePolicy { get; }
103+
104+
/// <summary>
105+
/// Get or set the current cache. Defaults to MemoryCache.
106+
/// </summary>
107+
ICache Cache { get; set; }
108+
109+
#endregion Properties
110+
111+
#region Methods
112+
113+
/// <summary>
114+
/// Load API keys from an encrypted file - keys will stay encrypted in memory
115+
/// </summary>
116+
/// <param name="encryptedFile">Encrypted file to load keys from</param>
117+
void LoadAPIKeys(string encryptedFile);
88118

89119
/// <summary>
90120
/// Load API keys from unsecure strings

0 commit comments

Comments
 (0)