diff --git a/app/controllers/lnurlpay_controller.rb b/app/controllers/lnurlpay_controller.rb index 0ca11be..bc595bc 100644 --- a/app/controllers/lnurlpay_controller.rb +++ b/app/controllers/lnurlpay_controller.rb @@ -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