diff --git a/lnurl/lnurl.go b/lnurl/lnurl.go index bbdfc4a..800d177 100644 --- a/lnurl/lnurl.go +++ b/lnurl/lnurl.go @@ -38,7 +38,7 @@ func payRequest(c echo.Context) error { "callback": callback, "minSendable": MIN_SENDABLE_AMOUNT, "maxSendable": MAX_SENDABLE_AMOUNT, - "metadata": fmt.Sprintf("[[\"text/plain\",\"paying %s\"]]", name), + "metadata": lnurlMetadata(c), "tag": "payRequest", "commentAllowed": MAX_COMMENT_LENGTH, }, @@ -78,6 +78,14 @@ func pay(ln lightning.Lightning) echo.HandlerFunc { } } +func lnurlMetadata(c echo.Context) string { + s := "[" + s += fmt.Sprintf("[\"text/plain\",\"Paying %s@%s\"]", c.Param("name"), c.Request().Host) + s += fmt.Sprintf(",[\"text/identifier\",\"%s@%s\"]", c.Param("name"), c.Request().Host) + s += "]" + return s +} + func lnurlError(c echo.Context, code int, err error) error { return c.JSON(code, map[string]any{"status": "ERROR", "error": err.Error()}) }