Пример #1
0
        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);
        }
    }
Пример #2
0
        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);
        }
Пример #3
0
        /// <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;
        }
Пример #4
0
 public BittrexExchangeWrapper()
 {
     Exchange = SupportedExchanges.Bittrex;
 }