From 6f0bdf3634ddbf5ae5289f4e6aa86430bd80f9d2 Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Mon, 8 Jun 2015 14:00:58 -0500 Subject: display transaction details --- rpcblockchainexplorer/api.py | 7 +++++++ rpcblockchainexplorer/templates/transaction.html | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/rpcblockchainexplorer/api.py b/rpcblockchainexplorer/api.py index aedfe83..d759e04 100644 --- a/rpcblockchainexplorer/api.py +++ b/rpcblockchainexplorer/api.py @@ -207,6 +207,13 @@ def _getblock(blockhash): return render_template("block.html", block=block, txids=txids) +@api.route("/transaction/") +def _transaction(txid): + transaction = g.bitcoin_rpc_client._call("getrawtransaction", b2x(x(txid)), 1) + blockhash = transaction["blockhash"] + del transaction["blockhash"] + return render_template("transaction.html", transaction=transaction, blockhash=blockhash) + @api.route("/getblockcount") def _getblockcount(): blockcount = g.bitcoin_rpc_client.getblockcount() diff --git a/rpcblockchainexplorer/templates/transaction.html b/rpcblockchainexplorer/templates/transaction.html index 2cd67c8..dde57ed 100644 --- a/rpcblockchainexplorer/templates/transaction.html +++ b/rpcblockchainexplorer/templates/transaction.html @@ -2,6 +2,10 @@ {% block content %} + + + + {% for key_name in transaction.keys() %} -- cgit v1.2.3
block{{ blockhash }}
{{ key_name }}