mirror of
https://github.com/Such-Software/wowcheckout.git
synced 2026-10-17 05:51:45 +02:00
Fork xmrcheckout for Wownero (WOW)
Minimal changes from upstream xmrcheckout to support Wownero: - Rate provider: Nonlogs WOW-BTC via Kraken BTC/USD - Subaddress derivation: Wownero network byte overrides (53/63/54) - Payment URI scheme: wownero: - Dockerfile: Wownero binaries from Codeberg - Display text: Monero→Wownero, XMR→WOW throughout UI - Default daemon: 192.168.88.235:34568 - Added wownero-logo.svg File and folder structure kept identical to upstream for easy sync.
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 1.4 MiB |
@@ -0,0 +1,136 @@
|
||||
(function () {
|
||||
var state = {
|
||||
baseUrl: "",
|
||||
modal: null,
|
||||
iframe: null,
|
||||
handlers: [],
|
||||
};
|
||||
|
||||
function normalizeBaseUrl(url) {
|
||||
if (!url) {
|
||||
return "";
|
||||
}
|
||||
try {
|
||||
var parsed = new URL(url, window.location.href);
|
||||
var path = parsed.pathname.replace(/\/api\/v1\/?$/, "").replace(/\/api\/?$/, "");
|
||||
var normalized = parsed.origin + path;
|
||||
return normalized.replace(/\/$/, "");
|
||||
} catch (error) {
|
||||
return String(url).replace(/\/$/, "");
|
||||
}
|
||||
}
|
||||
|
||||
function resolveInvoiceUrl(invoiceId) {
|
||||
var base = state.baseUrl || "";
|
||||
if (!base) {
|
||||
base = "";
|
||||
}
|
||||
base = base.replace(/\/$/, "");
|
||||
return base + "/i/" + encodeURIComponent(invoiceId);
|
||||
}
|
||||
|
||||
function ensureModal() {
|
||||
if (state.modal) {
|
||||
return;
|
||||
}
|
||||
var overlay = document.createElement("div");
|
||||
overlay.setAttribute("data-btcpay-modal", "true");
|
||||
overlay.style.position = "fixed";
|
||||
overlay.style.inset = "0";
|
||||
overlay.style.display = "none";
|
||||
overlay.style.alignItems = "center";
|
||||
overlay.style.justifyContent = "center";
|
||||
overlay.style.background = "rgba(16, 18, 23, 0.6)";
|
||||
overlay.style.zIndex = "2147483647";
|
||||
overlay.style.padding = "24px";
|
||||
|
||||
var container = document.createElement("div");
|
||||
container.style.position = "relative";
|
||||
container.style.width = "min(92vw, 520px)";
|
||||
container.style.height = "min(86vh, 720px)";
|
||||
container.style.background = "#f8f2e9";
|
||||
container.style.borderRadius = "20px";
|
||||
container.style.boxShadow = "0 24px 50px rgba(16, 18, 23, 0.35)";
|
||||
container.style.overflow = "hidden";
|
||||
|
||||
var iframe = document.createElement("iframe");
|
||||
iframe.setAttribute("title", "Payment request");
|
||||
iframe.style.width = "100%";
|
||||
iframe.style.height = "100%";
|
||||
iframe.style.border = "0";
|
||||
iframe.style.background = "transparent";
|
||||
iframe.allow = "clipboard-read; clipboard-write";
|
||||
|
||||
container.appendChild(iframe);
|
||||
overlay.appendChild(container);
|
||||
document.body.appendChild(overlay);
|
||||
|
||||
overlay.addEventListener("click", function (event) {
|
||||
if (event.target === overlay) {
|
||||
hideFrame();
|
||||
}
|
||||
});
|
||||
|
||||
state.modal = overlay;
|
||||
state.iframe = iframe;
|
||||
}
|
||||
|
||||
function showInvoice(invoiceId) {
|
||||
if (!invoiceId) {
|
||||
return;
|
||||
}
|
||||
ensureModal();
|
||||
if (!state.modal || !state.iframe) {
|
||||
return;
|
||||
}
|
||||
state.iframe.src = resolveInvoiceUrl(invoiceId);
|
||||
state.modal.style.display = "flex";
|
||||
}
|
||||
|
||||
function hideFrame() {
|
||||
if (!state.modal) {
|
||||
return;
|
||||
}
|
||||
state.modal.style.display = "none";
|
||||
}
|
||||
|
||||
function onModalReceiveMessage(callback) {
|
||||
if (typeof callback !== "function") {
|
||||
return;
|
||||
}
|
||||
state.handlers.push(callback);
|
||||
}
|
||||
|
||||
function allowMessage(event) {
|
||||
if (!state.baseUrl) {
|
||||
return true;
|
||||
}
|
||||
try {
|
||||
var origin = new URL(state.baseUrl, window.location.href).origin;
|
||||
return event.origin === origin;
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener("message", function (event) {
|
||||
if (!allowMessage(event)) {
|
||||
return;
|
||||
}
|
||||
state.handlers.forEach(function (handler) {
|
||||
try {
|
||||
handler(event);
|
||||
} catch (error) {
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
window.btcpay = window.btcpay || {};
|
||||
window.btcpay.setApiUrlPrefix = function (baseUrl) {
|
||||
state.baseUrl = normalizeBaseUrl(baseUrl);
|
||||
};
|
||||
window.btcpay.showInvoice = showInvoice;
|
||||
window.btcpay.hideFrame = hideFrame;
|
||||
window.btcpay.onModalReceiveMessage = onModalReceiveMessage;
|
||||
})();
|
||||
@@ -0,0 +1 @@
|
||||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 3756.09 3756.49"><title>monero</title><path d="M4128,2249.81C4128,3287,3287.26,4127.86,2250,4127.86S372,3287,372,2249.81,1212.76,371.75,2250,371.75,4128,1212.54,4128,2249.81Z" transform="translate(-371.96 -371.75)" style="fill:#fff"/><path id="_149931032" data-name=" 149931032" d="M2250,371.75c-1036.89,0-1879.12,842.06-1877.8,1878,0.26,207.26,33.31,406.63,95.34,593.12h561.88V1263L2250,2483.57,3470.52,1263v1579.9h562c62.12-186.48,95-385.85,95.37-593.12C4129.66,1212.76,3287,372,2250,372Z" transform="translate(-371.96 -371.75)" style="fill:#f26822"/><path id="_149931160" data-name=" 149931160" d="M1969.3,2764.17l-532.67-532.7v994.14H1029.38l-384.29.07c329.63,540.8,925.35,902.56,1604.91,902.56S3525.31,3766.4,3855,3225.6H3063.25V2231.47l-532.7,532.7-280.61,280.61-280.62-280.61h0Z" transform="translate(-371.96 -371.75)" style="fill:#4d4d4d"/></svg>
|
||||
|
After Width: | Height: | Size: 940 B |
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 26.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="svg898" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 64 64" style="enable-background:new 0 0 64 64;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#FF2AD4;}
|
||||
.st1{fill:#FFFFFF;}
|
||||
.st2{fill:#FFCC00;}
|
||||
</style>
|
||||
<path id="path6" class="st0" d="M61.5,19.5C54.6,3.3,35.8-4.3,19.5,2.5s-23.9,25.7-17,41.9s25.7,23.9,41.9,17
|
||||
c7.7-3.2,13.8-9.3,17-17C64.8,36.5,64.8,27.5,61.5,19.5z"/>
|
||||
<path class="st1" d="M7.4,26.3h8.2v15.6v6.4l4.6-4.4l11.9-11.2l11.8,11.2l4.6,4.4v-6.4l0-15.6h8.1c0.4,1.8,0.6,3.7,0.6,5.6
|
||||
c0,13.9-11.3,25.3-25.2,25.3S6.7,45.8,6.7,31.9C6.7,30,6.9,28.1,7.4,26.3 M5.3,23.5C0.7,38.3,8.9,54,23.7,58.6s30.5-3.7,35-18.4
|
||||
c0.8-2.7,1.3-5.5,1.3-8.3c0-2.8-0.4-5.6-1.3-8.4H45.8l-0.1,18.4L32.1,28.8L18.3,41.9V23.5H5.3z"/>
|
||||
<path class="st2" d="M18.3,20.8H21v2.8v12l9.1-8.7l1.9-1.8l1.9,1.8l9.1,8.6v-12v-2.7h14.7C51.5,6.6,34.9,0.2,20.8,6.4
|
||||
c-6.4,2.8-11.6,8-14.4,14.4H18.3z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
Reference in New Issue
Block a user