diff --git a/public/index.html b/public/index.html index 97f222f..71bd961 100644 --- a/public/index.html +++ b/public/index.html @@ -78,6 +78,28 @@

PayJoin here to open these channels

Please use a wallet that supports BIP 78 P2EP PayJoins!

+
+
+ +
+ Buy Inbound Lighning Channel +
+ +
+ +
@@ -90,6 +112,24 @@

PayJoin here to open these channels

channels.appendChild(div.lastChild); } + async function get_inbound_quote(){ + try { + quote = await (await fetch('/getinbound', { + method: 'GET', + })).json() + document.getElementById("getinbound-button-wrapper").classList.add("invisible"); + document.getElementById("getinbound-response").classList.remove("invisible"); + document.getElementById("getinbound-price").innerHTML = quote.price; + document.getElementById("getinbound-price-2").innerHTML = quote.price; + document.getElementById("getinbound-capacity").innerHTML = quote.size; + document.getElementById("getinbound-duration").innerHTML = quote.duration; + document.getElementById("getinbound-address").innerHTML = quote.address; + } catch (error) { + console.error(error) + alert("Something went wrong. Please try again.") + } + } + function remove_channel() { let channels = document.getElementById("channels"); let channelInputs = channels.getElementsByTagName("input");