Browse Source

Donation: Add lightning node

refactor
Hampus Sjöberg 4 years ago
parent
commit
245b25dc38
  1. 3
      config/config.ts_TEMPLATE
  2. 23
      frontend/components/Donation.tsx

3
config/config.ts_TEMPLATE

@ -45,6 +45,8 @@ interface Config {
cert: string;
// Path to invoice.macaroon
macaroon: string;
// Lightning Node URI <pubkey>@<ip:port>
lightningNodeUri?: string;
};
// URL to the LNURL-pay endpoint
lnurlPayUrl: string;
@ -78,6 +80,7 @@ const config: Config = {
// server: "https://127.0.0.1:8080",
// cert: "/path/to/tls.cert",
// macaroon: "/path/to/invoice.macaroon",
// lightningNodeUri: "pubkey@ip:port"
// },
// },
// lnurlPayUrl: "https://domain.com/invoice",

23
frontend/components/Donation.tsx

@ -46,6 +46,23 @@ export const ChangeToBolt11 = styled.a`
font-size: 14px;
`;
export const ConnectToNodeTitle = styled.p`
display: block;
overflow-wrap: anywhere;
font-size: 12px;
color: #aaa;
margin-top: 17px;
margin-bottom: 4px;
`;
export const ConnectToNodeData = styled.p`
display: block;
overflow-wrap: anywhere;
font-size: 12px;
color: #aaa;
margin-top: 0;
`;
const lnurlPayBech32 = bech32.encode(
"lnurl",
bech32.toWords(new TextEncoder().encode(config.donation?.lnurlPayUrl)),
@ -115,6 +132,12 @@ export function Donation() {
Unsupported wallet? Click to change to normal BOLT11 invoice
</ChangeToBolt11>
)}
{config.donation?.data.lightningNodeUri && (
<>
<ConnectToNodeTitle>The Lightning Node:</ConnectToNodeTitle>
<ConnectToNodeData>{config.donation.data.lightningNodeUri}</ConnectToNodeData>
</>
)}
</>
)}
</DonateContainer>

Loading…
Cancel
Save