Skip to content

Commit

Permalink
Show fee rate for asset
Browse files Browse the repository at this point in the history
  • Loading branch information
Impa10r committed May 21, 2024
1 parent 76aed5c commit 7d31611
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
7 changes: 4 additions & 3 deletions cmd/psweb/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ var (
//go:embed static
staticFiles embed.FS
//go:embed templates/*.gohtml
tplFolder embed.FS
logFile *os.File
latestVersion = version
tplFolder embed.FS
logFile *os.File
latestVersion = version
// Bitcoin sat/vB from mempool.space
mempoolFeeRate = float64(0)
// onchain realized transaction costs
txFee = make(map[string]int64)
Expand Down
13 changes: 6 additions & 7 deletions cmd/psweb/templates/peer.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,6 @@
function calculateTransactionFee() {
var asset = document.getElementById("asset").value;
var swapAmount = Number(document.getElementById("swapAmount").value);

// amount cannot be blank
if (swapAmount < 100000) {
document.getElementById('result').innerText = "Please enter the Swap Amount";
return;
}

let fee = 0;
let feeRate = {{.MempoolFeeRate}}; // LBTC
let title = "";
Expand All @@ -156,6 +149,12 @@
// Liquid
document.getElementById("mempoolFeeRate").textContent = "{{.MempoolFeeRate}} sats/vB"
}

// amount cannot be blank
if (swapAmount < 100000) {
document.getElementById('result').innerText = "Please enter the Swap Amount";
return;
}

if (document.getElementById("direction").value == "swapIn") {
title = "Assumed UTXOs:\n";
Expand Down

0 comments on commit 7d31611

Please sign in to comment.