From 34849b28b0a9e5e84c9193ecda744e466d243995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Mon, 1 May 2023 15:15:23 +0200 Subject: [PATCH] WIP show fees of Lightning transactions --- app/controllers/wallet_controller.rb | 1 + app/views/wallet/transactions.html.erb | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/wallet_controller.rb b/app/controllers/wallet_controller.rb index a7920d4..07de29b 100644 --- a/app/controllers/wallet_controller.rb +++ b/app/controllers/wallet_controller.rb @@ -78,6 +78,7 @@ class WalletController < ApplicationController tx["received"] = true else tx["amount_sats"] = tx["value"] || tx["amt"] + tx["fee"] = tx["type"] == "paid_invoice" ? tx["fee"] : nil tx["datetime"] = Time.at(tx["timestamp"].to_i) tx["title"] = tx["type"] == "paid_invoice" ? "Sent" : "Received" tx["description"] = tx["memo"] || tx["description"] diff --git a/app/views/wallet/transactions.html.erb b/app/views/wallet/transactions.html.erb index 44859e3..5ebc2cc 100644 --- a/app/views/wallet/transactions.html.erb +++ b/app/views/wallet/transactions.html.erb @@ -35,7 +35,8 @@

- <%= tx["datetime"].strftime("%B %e, %H:%M") %> + <%= tx["datetime"].strftime("%B %e, %H:%M") -%> + <% if tx["fee"] && (tx["fee"] > 0) %>, Fee: <%= tx["fee"] %> sats<% end %>