mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2026-04-12 16:13:12 +00:00
Updated API credential logic, exchange implementation are expected to provide their own credentials implementation with ApiCredentials as base class Removed ApiCredentials implementation used by most exchanges Removed ApiCredentialsType Enum Added CredentialSet base class and implementations for defining different API credentials Added optional type param to AuthenticationProvider for the specific API credential type to improve type safety Moved AuthenticationProvider/ApiCredentials from BaseApiClient to RestApiClient/SocketApiClient base classes Added optional type params to RestApiClient/SocketApiClient base class to specify the AuthenticationProvider type and credentials type to improve type safety Moved SetOptions/SetApiCredentials from BaseApiClient to RestApiClient/SocketApiClient Extracted LibraryOptions<TRestOptions, TSocketOptions, TEnvironment> without TApiCredentials for libraries without API credentials Removed ApiCredentials from ApiOptions, credentials can only be configured at library, rest or socket level Added EnvironmentName to RestApiClient/SocketApiClient property Added Unknown enum value to Shared interfaces SharedOrderStatus, SharedTransferStatus and SharedTriggerOrderStatus enums Updated Enum converter to map value to an undefined Enum value instead of the first Enum value Added support for checking for missing fields on RestIntegrationTest Added BytesToHexString and HexToBytesString to ExchangeHelpers static class Fixed bug where WebSocket connections are not reconnected when configuring Proxy with SetUpdates Removed legacy CryptoBaseClient, CryptoRestClient and CryptoSocketClient
35 lines
1.3 KiB
C#
35 lines
1.3 KiB
C#
using CryptoExchange.Net.Authentication;
|
|
using System;
|
|
|
|
namespace CryptoExchange.Net.Objects.Options
|
|
{
|
|
/// <summary>
|
|
/// Socket api options
|
|
/// </summary>
|
|
public class SocketApiOptions : ApiOptions
|
|
{
|
|
/// <summary>
|
|
/// The max time of not receiving any data after which the connection is assumed to be dropped. This can only be used for socket connections where a steady flow of data is expected,
|
|
/// for example when the server sends intermittent ping requests
|
|
/// </summary>
|
|
public TimeSpan? SocketNoDataTimeout { get; set; }
|
|
|
|
/// <summary>
|
|
/// The max amount of connections to make to the server. Can be used for API's which only allow a certain number of connections. Changing this to a high value might cause issues.
|
|
/// </summary>
|
|
public int? MaxSocketConnections { get; set; }
|
|
|
|
/// <summary>
|
|
/// Set the values of this options on the target options
|
|
/// </summary>
|
|
public T Set<T>(T item) where T : SocketApiOptions, new()
|
|
{
|
|
item.OutputOriginalData = OutputOriginalData;
|
|
item.SocketNoDataTimeout = SocketNoDataTimeout;
|
|
item.AutoTimestamp = AutoTimestamp;
|
|
item.MaxSocketConnections = MaxSocketConnections;
|
|
return item;
|
|
}
|
|
}
|
|
}
|