Example #1
0
        public JsonResult Index()
        {
            var rawTxs   = RpcHelper.RequestJson <TxPoolResp>("f_on_transactions_pool_json", new Dictionary <string, object>()).result.transactions;
            var txHashes = new List <string>();

            foreach (var rawTx in rawTxs)
            {
                txHashes.Add(rawTx.hash);
            }
            var tx_args = new Dictionary <string, object>();

            tx_args.Add("transactionHashes", txHashes.ToArray());
            var txs = RpcHelper.Request <TxDetailResp>("get_transaction_details_by_hashes", tx_args);

            List <CachedTx> transactions = new List <CachedTx>();

            if (txs != null)
            {
                foreach (var rawTx in txs.transactions)
                {
                    var memPoolTx = TransactionHelpers.MapTx(rawTx);
                    memPoolTx.height = 0;
                    transactions.Add(memPoolTx);
                }
            }
            return(new JsonResult(JsonConvert.SerializeObject(transactions)));
        }
Example #2
0
        public JsonResult Index()
        {
            var stats = RpcHelper.RequestJson <NetworkStats>("getlastblockheader").result.block_header;

            return(new JsonResult(stats));
        }