Esempio n. 1
0
 protected override UpdaterResult fetchUpdateResult()
 {
     UpdaterResult r = new UpdaterResult();
     Balance b;
     try
     {
         b = _link.GetBalance();
     }
     catch (Exception e)
     {
         r.LongVals.Add(-1);
         return r;
     }
     r.LongVals.Add(b.TotalBalance[_currency]);
     return r;
 }
Esempio n. 2
0
        protected override UpdaterResult fetchUpdateResult()
        {
            if (_link.GetType() == typeof(StampLink))
            {
                UpdaterResult r = new UpdaterResult();
                ExchangeRate e = ((StampLink)_link).GetEurUsdRate();

                r.DoubleVals.Add(e.Buy);
                r.DoubleVals.Add(e.Sell);

                return r;
            }
            else
            {
                return null;
            }
        }
Esempio n. 3
0
 private void UpdateSellFee(UpdaterResult result)
 {
     double fee = result.DoubleVals[0];
     if (fee != _sellFee)
     {
         Log("Kraken fee changed to " + fee.ToString() + "%", 0);
         _sellFee = fee;
     }
 }
Esempio n. 4
0
 private void UpdateSellBalance(UpdaterResult result)
 {
     long balance = result.LongVals[0];
     if (balance == -1)
     {
         Log("ERROR", 1);
         _sellBalance = 0;
     }
     else
     {
         Log(ExchangeUtils.SatoshiToString(balance) + " XBT", 1);
         _sellBalance = balance;
     }
 }
Esempio n. 5
0
 private void UpdateExchangeRate(UpdaterResult result)
 {
     _exchangeRate.Buy = result.DoubleVals[0];
     _exchangeRate.Sell = result.DoubleVals[1];
     Log("EUR/USD rates: (Buy) " + _exchangeRate.Buy.ToString() + " - (Sell) " + _exchangeRate.Sell.ToString(), 0);
 }
Esempio n. 6
0
 private void UpdateBuyFee(UpdaterResult result)
 {
     double fee = result.DoubleVals[0];
     if (fee != _buyFee)
     {
         Log("Bitstamp fee changed to " + fee.ToString() + "%", 0);
         _buyFee = fee;
     }
 }
Esempio n. 7
0
 private void UpdateBuyBalance(UpdaterResult result)
 {
     long balance = result.LongVals[0];
     Log(ExchangeUtils.SatoshiToString(balance) + " USD", 2);
     _buyBalance = balance;
 }