Exemplo n.º 1
0
 public Task GetAccount()
 {
     return(DefaultApi.GetAccount(new GetAccountRequest()
     {
         account_name = "eosio"
     }));
 }
Exemplo n.º 2
0
        public async Task <wallet.Models.Account> GetAccountAsync(AccountRequest request)
        {
            var currencyBalanceInfo = await m_EosApi.GetCurrencyBalance(new GetCurrencyBalanceRequest()
            {
                code    = "eosio.token",
                account = request.Name,
                symbol  = "VHKD"
            });

            decimal currencyBalance = 0;

            if (currencyBalanceInfo.assets.Count > 0)
            {
                currencyBalance = decimal.Parse(currencyBalanceInfo.assets[0].Split(' ')[0]);
            }
            Account result = null;

            try
            {
                var account = await m_EosApi.GetAccount(new GetAccountRequest { account_name = request.Name });

                result = new Account()
                {
                    Balance     = currencyBalance,
                    Created     = account.created,
                    Permissions = account.permissions.SelectMany(p => p.required_auth.keys.Select(k => k.key)).Distinct().ToArray()
                };
            }
            catch { }
            return(result);
        }