Announce nostr pubkey on lnurlp endpoint

This commit is contained in:
Râu Cao 2024-03-31 12:11:06 +03:00
parent 46b4723999
commit f2507409a3
Signed by: raucao
GPG Key ID: 37036C356E56CC51

View File

@ -8,7 +8,7 @@ class LnurlpayController < ApplicationController
# GET /.well-known/lnurlp/:username # GET /.well-known/lnurlp/:username
def index def index
render json: { res = {
status: "OK", status: "OK",
callback: "https://#{Setting.accounts_domain}/lnurlpay/#{@user.cn}/invoice", callback: "https://#{Setting.accounts_domain}/lnurlpay/#{@user.cn}/invoice",
tag: "payRequest", tag: "payRequest",
@ -17,6 +17,13 @@ class LnurlpayController < ApplicationController
metadata: metadata(@user.address), metadata: metadata(@user.address),
commentAllowed: MAX_COMMENT_CHARS 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 end
# GET /.well-known/keysend/:username # GET /.well-known/keysend/:username