diff --git a/CryptoExchange.Net/Clients/BaseSocketClient.cs b/CryptoExchange.Net/Clients/BaseSocketClient.cs index 7031b0e..2e1541a 100644 --- a/CryptoExchange.Net/Clients/BaseSocketClient.cs +++ b/CryptoExchange.Net/Clients/BaseSocketClient.cs @@ -6,6 +6,7 @@ using System.Linq; using System.Net.WebSockets; using System.Threading; using System.Threading.Tasks; +using CryptoExchange.Net.Authentication; using CryptoExchange.Net.Interfaces; using CryptoExchange.Net.Objects; using CryptoExchange.Net.Sockets; @@ -111,6 +112,13 @@ namespace CryptoExchange.Net ClientOptions = options; } + /// + public void SetApiCredentials(ApiCredentials credentials) + { + foreach (var apiClient in ApiClients) + apiClient.SetApiCredentials(credentials); + } + /// /// Set a delegate to be used for processing data received from socket connections before it is processed by handlers /// diff --git a/CryptoExchange.Net/Interfaces/ISocketClient.cs b/CryptoExchange.Net/Interfaces/ISocketClient.cs index 7502334..be81455 100644 --- a/CryptoExchange.Net/Interfaces/ISocketClient.cs +++ b/CryptoExchange.Net/Interfaces/ISocketClient.cs @@ -1,5 +1,6 @@ using System; using System.Threading.Tasks; +using CryptoExchange.Net.Authentication; using CryptoExchange.Net.Objects; using CryptoExchange.Net.Sockets; @@ -15,6 +16,12 @@ namespace CryptoExchange.Net.Interfaces /// BaseSocketClientOptions ClientOptions { get; } + /// + /// Set the API credentials for this client. All Api clients in this client will use the new credentials, regardless of earlier set options. + /// + /// The credentials to set + void SetApiCredentials(ApiCredentials credentials); + /// /// Incoming kilobytes per second of data ///