Ejemplo n.º 1
0
        /// <summary>
        /// Renew address items balances
        /// </summary>
        /// <param name="api">Iri api</param>
        /// <param name="addressItems">Address items to renew</param>
        /// <returns></returns>
        public static async Task RenewBalances(this IriApi api, params AddressItem[] addressItems)
        {
            if (addressItems.Length == 0)
            {
                return;
            }
            var addresses = addressItems.Select(a => a.Address).ToArray();
            var balances  = await api.GetBalances(addresses);

            if (balances.Successful)
            {
                for (int i = 0; i < addressItems.Length; i++)
                {
                    addressItems[i].Balance = balances.Result[i];
                }
            }
        }
Ejemplo n.º 2
0
 public static Task <APIResult <long[]> > GetBalances(this IriApi api, params string[] addresses)
 {
     return(api.GetBalances(addresses, 100));
 }