public async Task Ethbal([Remainder] string address = null) { NanoPool.UserAccount account = NanoPool.GetUser(Context.User, address); string msg = ""; if (account == null) { msg = "Account **" + address + "**\nNot Found! Please use linketh cmd or enter an address to link!"; await PrintEmbedMessage("Account Retrieval Failed", msg); return; } if (address == null) { address = account.address; } double balance = double.Parse(EtherScan.GetBalance(address)) / 1000000000000000000d; NanoPool.Prices prices = NanoPool.GetPrices(); double usdBal = prices.price_usd * balance; double btcBal = prices.price_btc * balance; double gbpBal = prices.price_gbp * balance; double eurBal = prices.price_eur * balance; msg += "**Account:** " + address; msg += "\n**Balance:** " + string.Format("{0:N15} ETH", balance); msg += "\n**USD Value:** " + string.Format("${0:N2}", usdBal); msg += "\n**BTC Value:** " + string.Format("{0:N8} BTC", btcBal); await PrintEmbedMessage("Ethereum Balance", msg); //await Context.Channel.SendMessageAsync(msg); }
public string GetNanoPoolInfo(string address, SocketUser user) { NanoPool.Account account = NanoPool.GetAccount(address, user); string msg = ""; if (account == null) { msg = "Account **" + address + "**\nNot Found!"; return(msg); } msg += "**Account:** " + account.account; msg += "\n**Unconfirmed Balance:** " + account.unconfirmed_balance; msg += "\n**Balance:** " + account.balance; double balance = double.Parse(account.balance); NanoPool.Prices prices = NanoPool.GetPrices(); double usdBal = prices.price_usd * balance; double btcBal = prices.price_btc * balance; double gbpBal = prices.price_gbp * balance; double eurBal = prices.price_eur * balance; msg += "\n**USD Value:** " + string.Format("${0:N2}", usdBal); msg += "\n**BTC Value:** " + string.Format("{0:N8} BTC", btcBal); msg += "\n**Hashrate:** " + account.hashrate + " Mh/s"; msg += "\n\n__Average Hashrate__"; msg += "\n**1 Hour:** " + account.avgHashrate["h1"] + " Mh/s"; msg += "\n**3 Hours:** " + account.avgHashrate["h3"] + " Mh/s"; msg += "\n**6 Hours:** " + account.avgHashrate["h6"] + " Mh/s"; msg += "\n**12 Hours:** " + account.avgHashrate["h12"] + " Mh/s"; msg += "\n**24 Hours:** " + account.avgHashrate["h24"] + " Mh/s"; msg += "\n\n__Workers__"; for (int i = 0; i < account.workers.Count; i++) { if (i > 0) { msg += "\n"; } msg += "\n**ID:** " + account.workers[i].id; msg += "\n**UID:** " + account.workers[i].uid; msg += "\n**Hashrate:** " + account.workers[i].hashrate + " Mh/s"; msg += "\n**Last Share:** " + SteamAccounts.UnixTimeStampToDateTime(account.workers[i].lastshare); msg += "\n**Rating:** " + account.workers[i].rating; /* * msg += "\n**1hr Avg Hashrate:** " + account.workers[i].h1 + " Mh/s"; * msg += "\n**3hr Avg Hashrate:** " + account.workers[i].h3 + " Mh/s"; * msg += "\n**6hr Avg Hashrate:** " + account.workers[i].h6 + " Mh/s"; * msg += "\n**12hr Avg Hashrate:** " + account.workers[i].h12 + " Mh/s"; * msg += "\n**24hr Avg Hashrate:** " + account.workers[i].h24 + " Mh/s"; */ } return(msg); }