Esempio n. 1
0
        public TransactionsData ScHistory(int page, string from, string to)
        {
            using (var client = CreateApi())
            {
                var data  = new TransactionsData();
                var pools = client.PoolListGet(0, 100);
                foreach (var poolsPool in pools.Pools)
                {
                    if (poolsPool.TransactionsCount == 0)
                    {
                        continue;
                    }
                    var poolHash = ConvUtils.ConvertHashAscii(poolsPool.Hash);
                    var trs      = client.PoolTransactionsGet(poolsPool.Hash, 0, 0, long.MaxValue);
                    var i        = 1;
                    foreach (var trsTransaction in trs.Transactions)
                    {
                        if (string.IsNullOrEmpty(trsTransaction.SmartContract?.SourceCode))
                        {
                            continue;
                        }
                        data.Transactions.Add(new TransactionInfo(i, $"{poolHash}.{i}", trsTransaction));
                        i++;
                    }
                }

                data.Page         = page;
                data.HaveNextPage = false;
                return(data);
            }
        }