Esempio n. 1
0
        public static async Task <TransactionItem[]> FindTransactionItemsFromHashes(this IriApi api,
                                                                                    params string[] hashes)
        {
            var transactionTrytes = await api.GetTrytes(hashes);

            return(transactionTrytes.Select(t => new TransactionItem(t)).ToArray());
        }
Esempio n. 2
0
        public static async Task <string[]> FindTransactionsFromAddresses(this IriApi api,
                                                                          params string[] addresses)
        {
            var transactionTrytes = await api.FindTransactions(addresses, null, null, null);

            return(transactionTrytes);
        }
Esempio n. 3
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);

            for (int i = 0; i < addressItems.Length; i++)
            {
                addressItems[i].Balance = balances[i];
            }
        }
Esempio n. 4
0
 public static Task <long[]> GetBalances(this IriApi api, params string[] addresses)
 {
     return(api.GetBalances(addresses, 100));
 }
Esempio n. 5
0
        public static async Task <TransactionItem[]> FindTransactionItemsFromAddresses(this IriApi api,
                                                                                       params string[] addresses)
        {
            var transactionHashes = await api.FindTransactionsFromAddresses(addresses);

            return(await api.FindTransactionItemsFromHashes(transactionHashes));
        }