private void OnListAssetCommand() { if (NoWallet()) { return; } foreach (UInt160 account in CurrentWallet.GetAccounts().Select(p => p.ScriptHash)) { Console.WriteLine(account.ToAddress()); Console.WriteLine($"NEO: {CurrentWallet.GetBalance(NativeContract.NEO.Hash, account)}"); Console.WriteLine($"GAS: {CurrentWallet.GetBalance(NativeContract.GAS.Hash, account)}"); Console.WriteLine(); } Console.WriteLine("----------------------------------------------------"); Console.WriteLine("Total: " + "NEO: " + CurrentWallet.GetAvailable(NativeContract.NEO.Hash) + " GAS: " + CurrentWallet.GetAvailable(NativeContract.GAS.Hash)); Console.WriteLine(); Console.WriteLine("NEO hash: " + NativeContract.NEO.Hash); Console.WriteLine("GAS hash: " + NativeContract.GAS.Hash); }
private void OnListAssetCommand() { var snapshot = NeoSystem.StoreView; if (NoWallet()) { return; } foreach (UInt160 account in CurrentWallet.GetAccounts().Select(p => p.ScriptHash)) { Console.WriteLine(account.ToAddress(NeoSystem.Settings.AddressVersion)); ConsoleHelper.Info("NEO: ", $"{CurrentWallet.GetBalance(snapshot, NativeContract.NEO.Hash, account)}"); ConsoleHelper.Info("GAS: ", $"{CurrentWallet.GetBalance(snapshot, NativeContract.GAS.Hash, account)}"); Console.WriteLine(); } Console.WriteLine("----------------------------------------------------"); ConsoleHelper.Info("Total: NEO: ", $"{CurrentWallet.GetAvailable(snapshot, NativeContract.NEO.Hash),10} ", "GAS: ", $"{CurrentWallet.GetAvailable(snapshot, NativeContract.GAS.Hash),18}"); Console.WriteLine(); ConsoleHelper.Info("NEO hash: ", NativeContract.NEO.Hash.ToString()); ConsoleHelper.Info("GAS hash: ", NativeContract.GAS.Hash.ToString()); }
private bool OnListAssetCommand(string[] args) { if (NoWallet()) { return(true); } var snapshot = NeoSystem.StoreView; foreach (UInt160 account in CurrentWallet.GetAccounts().Select(p => p.ScriptHash)) { Console.WriteLine(account.ToAddress(NeoSystem.Settings.AddressVersion)); Console.WriteLine($"NEO: {CurrentWallet.GetBalance(snapshot, NativeContract.NEO.Hash, account)}"); Console.WriteLine($"GAS: {CurrentWallet.GetBalance(snapshot, NativeContract.GAS.Hash, account)}"); Console.WriteLine(); } Console.WriteLine("----------------------------------------------------"); Console.WriteLine($"Total: NEO: {CurrentWallet.GetAvailable(snapshot, NativeContract.NEO.Hash),10} GAS: {CurrentWallet.GetAvailable(snapshot, NativeContract.GAS.Hash),18}"); Console.WriteLine(); Console.WriteLine("NEO hash: " + NativeContract.NEO.Hash); Console.WriteLine("GAS hash: " + NativeContract.GAS.Hash); return(true); }