1
1
mirror of https://github.com/bumi/lntip synced 2026-02-17 22:47:50 +00:00

6 Commits

Author SHA1 Message Date
70028e4264 Merge pull request #60 from reneaaron/fix/isenabled
fix: implement webln spec
2024-05-31 20:54:03 +03:00
René Aaron
47efbfcc96 fix: implement webln spec 2024-05-21 15:30:47 +02:00
b9b2ce8d6b Merge pull request #58 from crc32/patch-3
Update README.md
2023-06-05 09:20:46 +02:00
Arceris
f604ca21ce Update README.md
Added location of LND TLS for Start9
2023-06-03 16:54:49 -06:00
530c7c0942 Merge pull request #50 from ziggie1984/add-private-route-hints
add private routing hints for invoices
2023-01-28 13:02:18 +02:00
ziggie
23a134b28e add private routing hints for invoices 2023-01-23 10:08:26 +01:00
4 changed files with 10 additions and 11 deletions

View File

@@ -124,6 +124,7 @@ The TLS cert is located in the lnd directory:
- ~/umbrel/lnd/tls.cert on Umbrel
- /mnt/hdd/lnd/tls.cert on Raspiblitz
- /embassy-data/package-data/volumes/lnd/data/main/tls.cert on Start9 Embassy
- Can also be located in ~/.lnd
You should find the macaroon files in the LND data dir (e.g. ~.lnd/data/chain/bitcoin/mainnet/) or see "LND Permissions" how to create a new one.

View File

@@ -120,15 +120,11 @@ class LnMe {
}
payWithWebln() {
if (!webln.isEnabled) {
webln.enable().then((weblnResponse) => {
return webln.sendPayment(this.invoice.payment_request);
}).catch((e) => {
return this.showPaymentRequest();
})
} else {
webln.enable().then((weblnResponse) => {
return webln.sendPayment(this.invoice.payment_request);
}
}).catch((e) => {
return this.showPaymentRequest();
})
}
populatePaymentRequest() {

View File

@@ -47,7 +47,7 @@ type LNDclient struct {
}
// AddInvoice generates an invoice with the given price and memo.
func (c LNDclient) AddInvoice(value int64, memo string, descriptionHash []byte) (Invoice, error) {
func (c LNDclient) AddInvoice(value int64, memo string, descriptionHash []byte, private bool) (Invoice, error) {
result := Invoice{}
stdOutLogger.Printf("Adding invoice: memo=%s value=%v", memo, value)
@@ -55,6 +55,7 @@ func (c LNDclient) AddInvoice(value int64, memo string, descriptionHash []byte)
Memo: memo,
DescriptionHash: descriptionHash,
Value: value,
Private: private,
}
res, err := c.lndClient.AddInvoice(c.ctx, &invoice)
if err != nil {

View File

@@ -117,7 +117,7 @@ func main() {
return c.JSON(http.StatusBadRequest, "Bad request")
}
invoice, err := lnClient.AddInvoice(i.Value, i.Memo, nil)
invoice, err := lnClient.AddInvoice(i.Value, i.Memo, nil, cfg.Bool("enable-private-channels"))
if err != nil {
stdOutLogger.Printf("Error creating invoice: %s", err)
return c.JSON(http.StatusInternalServerError, "Error adding invoice")
@@ -190,7 +190,7 @@ func main() {
return c.JSON(http.StatusOK, lnurl.LNURLErrorResponse{Status: "ERROR", Reason: "Invalid comment length"})
}
metadataHash := sha256.Sum256([]byte(lnurlMetadata))
invoice, err := lnClient.AddInvoice(sats, comment, metadataHash[:])
invoice, err := lnClient.AddInvoice(sats, comment, metadataHash[:], cfg.Bool("enable-private-channels"))
if err != nil {
stdOutLogger.Printf("Error creating invoice: %s", err)
return c.JSON(http.StatusOK, lnurl.LNURLErrorResponse{Status: "ERROR", Reason: "Server Error"})
@@ -248,6 +248,7 @@ func LoadConfig() *koanf.Koanf {
f.Bool("disable-website", false, "Disable default embedded website.")
f.Bool("disable-ln-address", false, "Disable Lightning Address handling")
f.Bool("disable-cors", false, "Disable CORS headers.")
f.Bool("enable-private-channels", false, "Adds private routing hints to invoices")
f.Float64("request-limit", 5, "Request limit per second.")
f.String("static-path", "", "Path to a static assets directory.")
f.String("port", "", "Port to bind on (deprecated - use listen).")