Esempio n. 1
0
        // Get currency value in BTC for the given amount
        // where currency like "ETH", "NEO", "TRX", ...
        public static decimal BtcValue(this IExchangeAPI api, string currency, decimal amount)
        {
            var globalSymbol = currency + "-BTC";
            var symbol       = api.GlobalSymbolToExchangeSymbol(globalSymbol);
            var t            = api.GetTicker(symbol);
            var btcAmount    = t.MidPrice() * amount;

            Console.WriteLine("{0,-8} {1,-6} {2,13:0.00000000}        btc:{3,13:0.00000000}", api.Name, currency, amount, btcAmount);
            return(btcAmount);
        }