Beispiel #1
0
        /// <summary>
        /// Get account infomation
        /// </summary>
        /// <param name="parameters">
        /// Parameter Index
        /// [1] : Wallet address
        /// </param>
        /// <returns></returns>
        public static bool GetAccount(string command, string[] parameters)
        {
            string[] usage = new string[] {
                string.Format("{0} [command option] <address>\n", command)
            };

            string[] command_option = new string[] { HelpCommandOption.Help };

            if (parameters == null || parameters.Length != 1)
            {
                OutputHelpMessage(usage, null, command_option, null);
                return(true);
            }

            try
            {
                RpcApiResult result = RpcApi.GetAccount(parameters[0], out Account account);

                Console.WriteLine(PrintUtil.PrintAccount(account));
                OutputResultMessage(command, result.Result, result.Code, result.Message);
            }
            catch (System.Exception e)
            {
                Console.WriteLine(e.Message + "\n\n" + e.StackTrace);
            }

            return(true);
        }