Ejemplo 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());
        }
Ejemplo 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);
        }
Ejemplo 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];
            }
        }
Ejemplo n.º 4
0
 public static Task <long[]> GetBalances(this IriApi api, params string[] addresses)
 {
     return(api.GetBalances(addresses, 100));
 }
Ejemplo 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));
        }