Announce nostr pubkey on lnurlp endpoint

This commit is contained in:
2024-03-31 12:11:06 +03:00
parent 46b4723999
commit f2507409a3

View File

@@ -8,7 +8,7 @@ class LnurlpayController < ApplicationController
# GET /.well-known/lnurlp/:username
def index
render json: {
res = {
status: "OK",
callback: "https://#{Setting.accounts_domain}/lnurlpay/#{@user.cn}/invoice",
tag: "payRequest",
@@ -17,6 +17,13 @@ class LnurlpayController < ApplicationController
metadata: metadata(@user.address),
commentAllowed: MAX_COMMENT_CHARS
}
if Setting.nostr_enabled? && Setting.nostr_private_key.present?
res[:allows_nostr] = true
res[:nostrPubkey] = Setting.nostr_public_key
end
render json: res
end
# GET /.well-known/keysend/:username