Added View Raw TX JSON
This commit is contained in:
parent
4c6de231ac
commit
71a91900ad
|
@ -6,4 +6,13 @@ defmodule ZcashExplorerWeb.TransactionController do
|
||||||
tx_data = Zcashex.Transaction.from_map(tx)
|
tx_data = Zcashex.Transaction.from_map(tx)
|
||||||
render(conn, "tx.html", tx: tx_data, page_title: "Zcash Transaction #{txid}")
|
render(conn, "tx.html", tx: tx_data, page_title: "Zcash Transaction #{txid}")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def get_raw_transaction(conn, %{"txid" => txid}) do
|
||||||
|
{:ok, tx} = Zcashex.getrawtransaction(txid, 1)
|
||||||
|
data = Poison.encode!(tx, pretty: true)
|
||||||
|
|
||||||
|
conn
|
||||||
|
|> put_resp_content_type("application/json")
|
||||||
|
|> send_resp(200, data)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -53,6 +53,7 @@ defmodule ZcashExplorerWeb.Router do
|
||||||
pipe_through :api
|
pipe_through :api
|
||||||
get "/api/v1/blockchain-info", PageController, :blockchain_info_api
|
get "/api/v1/blockchain-info", PageController, :blockchain_info_api
|
||||||
post "/api/vk/:hostname", PageController, :vk_from_zecwalletcli
|
post "/api/vk/:hostname", PageController, :vk_from_zecwalletcli
|
||||||
|
get "/transactions/:txid/raw", TransactionController, :get_raw_transaction
|
||||||
end
|
end
|
||||||
|
|
||||||
# Other scopes may use custom stacks.
|
# Other scopes may use custom stacks.
|
||||||
|
|
|
@ -197,6 +197,19 @@
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="sm:col-span-1">
|
||||||
|
<dt class="text-sm font-medium text-gray-500">
|
||||||
|
Raw TX
|
||||||
|
</dt>
|
||||||
|
<dd class="mt-1 text-sm text-gray-900">
|
||||||
|
<a href={'/transactions/#{@tx.txid}/raw'}>
|
||||||
|
<span class="flex-1 w-0 break-all">
|
||||||
|
JSON
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue