public static async Task <ExchangeSettings> GetSettings(SupportedExchanges requestedExchange) { await using var database = new DatabaseContext(); ExchangeSettings settings = await database.ExchangeSettings.FirstOrDefaultAsync(x => x.Exchange == requestedExchange); settings ??= new() { Exchange = requestedExchange }; return(settings); } }
public ApiKeyData( SupportedExchanges exchange, string key, string secret, string password) { Exchange = exchange; _keyEntropy = GetNewEntropy(); _apiKey = ProtectData(key, _keyEntropy); _secretEntropy = GetNewEntropy(); _apiSecret = ProtectData(secret, _secretEntropy); _pwdEntropy = GetNewEntropy(); _apiPasssword = ProtectData(password, _pwdEntropy); }
/// <summary> /// Used for deserialization /// </summary> /// <param name="exchange"></param> /// <param name="key"></param> /// <param name="keyEntropy"></param> /// <param name="secret"></param> /// <param name="secretEntropy"></param> /// <param name="password"></param> /// <param name="passwordEntropy"></param> public ApiKeyData( SupportedExchanges exchange, byte[] key, byte[] keyEntropy, byte[] secret, byte[] secretEntropy, byte[] password, byte[] passwordEntropy) { Exchange = exchange; _keyEntropy = keyEntropy; _apiKey = key; _secretEntropy = secretEntropy; _apiSecret = secret; _pwdEntropy = passwordEntropy; _apiPasssword = password; }
public BittrexExchangeWrapper() { Exchange = SupportedExchanges.Bittrex; }