mirror of
https://github.com/bumi/lntip
synced 2026-02-17 22:47:50 +00:00
Compare commits
6 Commits
dependabot
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 70028e4264 | |||
|
|
47efbfcc96 | ||
| b9b2ce8d6b | |||
|
|
f604ca21ce | ||
| 530c7c0942 | |||
|
|
23a134b28e |
@@ -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.
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
5
lnme.go
5
lnme.go
@@ -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).")
|
||||
|
||||
Reference in New Issue
Block a user